2017-11-05 07:38:50 +08:00
|
|
|
"use strict";
|
|
|
|
|
2017-11-29 09:52:38 +08:00
|
|
|
async function syncNow() {
|
|
|
|
const result = await server.post('sync/now');
|
2017-11-05 09:21:09 +08:00
|
|
|
|
2017-11-29 09:52:38 +08:00
|
|
|
if (result.success) {
|
|
|
|
showMessage("Sync finished successfully.");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (result.message.length > 50) {
|
|
|
|
result.message = result.message.substr(0, 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
showError("Sync failed: " + result.message);
|
|
|
|
}
|
2017-12-31 10:44:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async function forceNoteSync(noteId) {
|
|
|
|
const result = await server.post('sync/force-note-sync/' + noteId);
|
|
|
|
|
|
|
|
showMessage("Note added to sync queue.");
|
2017-10-29 23:22:41 +08:00
|
|
|
}
|