You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Sync fixes
This commit is contained in:
@ -74,7 +74,9 @@ reg.synchronizer = async () => {
|
||||
return reg.synchronizer_;
|
||||
}
|
||||
|
||||
reg.scheduleSync = async () => {
|
||||
reg.scheduleSync = async (delay = null) => {
|
||||
if (delay === null) delay = 1000 * 10;
|
||||
|
||||
if (reg.scheduleSyncId_) {
|
||||
clearTimeout(reg.scheduleSyncId_);
|
||||
reg.scheduleSyncId_ = null;
|
||||
@ -92,8 +94,12 @@ reg.scheduleSync = async () => {
|
||||
}
|
||||
|
||||
const sync = await reg.synchronizer();
|
||||
sync.start();
|
||||
}, 1000 * 10);
|
||||
|
||||
let context = Setting.value('sync.context');
|
||||
context = context ? JSON.parse(context) : {};
|
||||
let newContext = await sync.start({ context: context });
|
||||
Setting.setValue('sync.context', JSON.stringify(newContext));
|
||||
}, delay);
|
||||
}
|
||||
|
||||
reg.setDb = (v) => {
|
||||
|
Reference in New Issue
Block a user