trilium/public/javascripts/sync.js

23 lines
589 B
JavaScript
Raw Normal View History

"use strict";
2017-10-29 23:22:41 +08:00
function syncNow() {
$.ajax({
url: baseApiUrl + 'sync/now',
type: 'POST',
success: result => {
if (result.success) {
2017-11-05 07:35:39 +08:00
status.checkStatus();
message("Sync finished successfully.");
2017-10-29 23:22:41 +08:00
}
else {
if (result.message.length > 50) {
result.message = result.message.substr(0, 50);
}
error("Sync failed: " + result.message);
2017-10-29 23:22:41 +08:00
}
},
error: () => error("Sync failed for unknown reason.")
2017-10-29 23:22:41 +08:00
});
}