1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Android: Fix file system sync issues (#6943)

This commit is contained in:
javad mnjd
2022-10-23 16:30:27 +03:30
committed by GitHub
parent 7129c0c14e
commit 5324f39561
7 changed files with 26 additions and 48 deletions

View File

@ -1,3 +1,5 @@
import debounce from './debounce';
const { NativeModules, Platform } = require('react-native');
export interface SharedData {
@ -9,7 +11,9 @@ export interface SharedData {
const ShareExtension = (NativeModules.ShareExtension) ?
{
data: () => NativeModules.ShareExtension.data(),
close: () => NativeModules.ShareExtension.close(),
// we debounce the `close` method, to keep alive permissions of Uris received from the share activity
// this is to prevent getting permission denied error while sharing the same file to joplin multiple times in a row
close: () => debounce(() => NativeModules.ShareExtension.close(), 3 * 60 * 1000), // close it after 3 minutes
shareURL: (Platform.OS === 'ios') ? NativeModules.ShareExtension.getConstants().SHARE_EXTENSION_SHARE_URL : '',
} :
{