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