2017-11-04 19:38:50 -04:00
|
|
|
"use strict";
|
|
|
|
|
2017-11-28 20:52:38 -05:00
|
|
|
async function syncNow() {
|
|
|
|
const result = await server.post('sync/now');
|
2017-11-04 21:21:09 -04:00
|
|
|
|
2017-11-28 20:52:38 -05: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-30 21:44:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
async function forceNoteSync(noteId) {
|
|
|
|
const result = await server.post('sync/force-note-sync/' + noteId);
|
|
|
|
|
|
|
|
showMessage("Note added to sync queue.");
|
2017-10-29 11:22:41 -04:00
|
|
|
}
|