mirror of
https://github.com/zadam/trilium.git
synced 2024-11-12 18:54:49 +08:00
21 lines
No EOL
562 B
JavaScript
21 lines
No EOL
562 B
JavaScript
"use strict";
|
|
|
|
function syncNow() {
|
|
$.ajax({
|
|
url: baseApiUrl + 'sync/now',
|
|
type: 'POST',
|
|
success: result => {
|
|
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);
|
|
}
|
|
},
|
|
error: () => showError("Sync failed for unknown reason.")
|
|
});
|
|
} |