mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 19:49:01 +01:00
24 lines
622 B
JavaScript
24 lines
622 B
JavaScript
import server from './server.js';
|
|
import toastService from "./toast.js";
|
|
|
|
async function syncNow(ignoreNotConfigured = false) {
|
|
const result = await server.post('sync/now');
|
|
|
|
if (result.success) {
|
|
toastService.showMessage(t("sync.finished-successfully"));
|
|
}
|
|
else {
|
|
if (result.message.length > 200) {
|
|
result.message = `${result.message.substr(0, 200)}...`;
|
|
}
|
|
|
|
if (!ignoreNotConfigured || result.errorCode !== 'NOT_CONFIGURED') {
|
|
toastService.showError(t("sync.failed", { message: result.message }));
|
|
}
|
|
}
|
|
}
|
|
|
|
export default {
|
|
syncNow
|
|
};
|