Fix previewing doc files more than once on Android (#2550)

This commit is contained in:
Elias Nahum 2019-02-05 19:12:56 -03:00
parent b24c97b7e9
commit d40b1da1d0
No known key found for this signature in database
GPG key ID: E038DB71E0B61702

View file

@ -267,12 +267,18 @@ export default class FileAttachmentDocument extends PureComponent {
}),
}]
);
this.setStatusBarColor();
this.onDonePreviewingFile();
RNFetchBlob.fs.unlink(path);
}
this.setState({downloading: false, progress: 0});
});
// Android does not trigger the event for DoneButtonEvent
// so we'll wait 4 seconds before enabling the tap for open the preview again
if (Platform.OS === 'android') {
setTimeout(this.onDonePreviewingFile, 4000);
}
}
}, delay);
};