Close share dialog on copy link
This commit is contained in:
@ -46,7 +46,7 @@ class Modals extends React.Component<Props> {
|
|||||||
<CollectionDelete onSubmit={this.handleClose} />
|
<CollectionDelete onSubmit={this.handleClose} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal name="document-share" title="Share document">
|
<Modal name="document-share" title="Share document">
|
||||||
<DocumentShare onSubmit={this.handleClose} />
|
<DocumentShare onCopyLink={this.handleClose} />
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal name="document-delete" title="Delete document">
|
<Modal name="document-delete" title="Delete document">
|
||||||
<DocumentDelete onSubmit={this.handleClose} />
|
<DocumentDelete onSubmit={this.handleClose} />
|
||||||
|
@ -10,6 +10,7 @@ import Document from 'models/Document';
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
document: Document,
|
document: Document,
|
||||||
|
onCopyLink: () => *,
|
||||||
};
|
};
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
@ -23,7 +24,11 @@ class DocumentShare extends React.Component<Props> {
|
|||||||
|
|
||||||
handleCopied = () => {
|
handleCopied = () => {
|
||||||
this.isCopied = true;
|
this.isCopied = true;
|
||||||
this.timeout = setTimeout(() => (this.isCopied = false), 3000);
|
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.isCopied = false;
|
||||||
|
this.props.onCopyLink();
|
||||||
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Reference in New Issue
Block a user