fix some things

This commit is contained in:
2019-10-27 13:24:57 +03:00
parent e794311aa1
commit 9434dd85cd
3 changed files with 9 additions and 10 deletions

View File

@@ -177,7 +177,7 @@ export class DocumentEditComponent extends React.PureComponent<
public copyLink() {
const doc = this.props.allDocs[this.state.id];
navigator.clipboard.writeText(
`http://${webRoot}/shared/${this.props.username}/${doc.id}`,
`${webRoot}/shared/${this.props.username}/${doc.id}`,
);
showSharedToast();
}

View File

@@ -30,6 +30,7 @@ export class DocumentViewComponent extends React.PureComponent<
const { id } = this.props.match.params as any;
if (this.props.allDocs) {
const doc = this.props.allDocs[id];
if (!doc) {
return <NotFound />;
}

View File

@@ -13,13 +13,11 @@ export function DocumentsList(props: IDocumentListProps) {
const cards = props.docs.map(doc => (
<DocumentCard key={doc.id} doc={doc} />
));
if (props.newDocument) {
return (
<div className="list">
{<NewDocumentCard />}
{cards}
</div>
);
}
return <div className="list">{cards}</div>;
return (
<div className="list">
{props.newDocument && <NewDocumentCard />}
{cards}
</div>
);
}