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