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() { public copyLink() {
const doc = this.props.allDocs[this.state.id]; const doc = this.props.allDocs[this.state.id];
navigator.clipboard.writeText( navigator.clipboard.writeText(
`http://${webRoot}/shared/${this.props.username}/${doc.id}`, `${webRoot}/shared/${this.props.username}/${doc.id}`,
); );
showSharedToast(); showSharedToast();
} }

View File

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

View File

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