You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Mobile: Added support for ResourceFetcher service
This commit is contained in:
@ -51,6 +51,7 @@ const { reducer, defaultState } = require('lib/reducer.js');
|
||||
const { FileApiDriverLocal } = require('lib/file-api-driver-local.js');
|
||||
const DropdownAlert = require('react-native-dropdownalert').default;
|
||||
const ShareExtension = require('react-native-share-extension').default;
|
||||
const ResourceFetcher = require('lib/services/ResourceFetcher');
|
||||
|
||||
const SyncTargetRegistry = require('lib/SyncTargetRegistry.js');
|
||||
const SyncTargetOneDrive = require('lib/SyncTargetOneDrive.js');
|
||||
@ -138,6 +139,10 @@ const generalMiddleware = store => next => async (action) => {
|
||||
DecryptionWorker.instance().scheduleStart();
|
||||
}
|
||||
|
||||
if (action.type === 'SYNC_CREATED_RESOURCE') {
|
||||
ResourceFetcher.instance().queueDownload(action.id);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -488,6 +493,10 @@ async function initialize(dispatch) {
|
||||
|
||||
ResourceService.runInBackground();
|
||||
|
||||
ResourceFetcher.instance().setFileApi(() => { return reg.syncTarget().fileApi() });
|
||||
ResourceFetcher.instance().setLogger(reg.logger());
|
||||
ResourceFetcher.instance().start();
|
||||
|
||||
reg.scheduleSync().then(() => {
|
||||
// Wait for the first sync before updating the notifications, since synchronisation
|
||||
// might change the notifications.
|
||||
|
Reference in New Issue
Block a user