mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
status converted to module
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
const status = (function() {
|
||||
const treeEl = $("#tree");
|
||||
const $changesToPushCountEl = $("#changesToPushCount");
|
||||
|
||||
async function checkStatus() {
|
||||
const resp = await $.ajax({
|
||||
@@ -34,7 +36,12 @@ async function checkStatus() {
|
||||
encryption.decryptTreeItems();
|
||||
}
|
||||
|
||||
$("#changesToPushCount").html(resp.changesToPushCount);
|
||||
$changesToPushCountEl.html(resp.changesToPushCount);
|
||||
}
|
||||
|
||||
setInterval(checkStatus, 5 * 1000);
|
||||
|
||||
return {
|
||||
checkStatus
|
||||
};
|
||||
})();
|
||||
@@ -4,7 +4,7 @@ function syncNow() {
|
||||
type: 'POST',
|
||||
success: result => {
|
||||
if (result.success) {
|
||||
checkStatus();
|
||||
status.checkStatus();
|
||||
|
||||
message("Sync triggered.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user