1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-04 21:53:18 +02:00

Sync when changing note or folder

This commit is contained in:
Laurent Cozic
2017-07-24 21:36:49 +01:00
parent cfa3c6f4bb
commit fc7163b324
4 changed files with 35 additions and 7 deletions

View File

@ -106,7 +106,7 @@ reg.scheduleSync = async (delay = null) => {
reg.logger().info('Scheduling sync operation...');
reg.scheduleSyncId_ = setTimeout(async () => {
const timeoutCallback = async () => {
reg.scheduleSyncId_ = null;
reg.logger().info('Doing scheduled sync');
@ -129,7 +129,13 @@ reg.scheduleSync = async (delay = null) => {
throw error;
}
}
}, delay);
};
if (delay === 0) {
timeoutCallback();
} else {
reg.scheduleSyncId_ = setTimeout(timeoutCallback, delay);
}
}
reg.setDb = (v) => {