fix: Drop to import

This commit is contained in:
Tom Moor
2019-10-12 23:03:58 -07:00
parent 5eb384b2c8
commit 01f672fac9
3 changed files with 16 additions and 16 deletions

View File

@ -11,6 +11,7 @@ import DocumentsStore from 'stores/DocumentsStore';
import LoadingIndicator from 'components/LoadingIndicator';
const EMPTY_OBJECT = {};
let importingLock = false;
type Props = {
children: React.Node,
@ -43,7 +44,10 @@ class DropToImport extends React.Component<Props> {
@observable isImporting: boolean = false;
onDropAccepted = async (files = []) => {
if (importingLock) return;
this.isImporting = true;
importingLock = true;
try {
let collectionId = this.props.collectionId;
@ -70,6 +74,7 @@ class DropToImport extends React.Component<Props> {
}
} finally {
this.isImporting = false;
importingLock = false;
}
};