mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-05-02 10:21:09 -05:00
number of sync changes to push next to "sync now" button
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
function checkStatus() {
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'status/' + globalFullLoadTime,
|
||||
type: 'GET',
|
||||
success: resp => {
|
||||
if (resp.changed) {
|
||||
window.location.reload(true);
|
||||
}
|
||||
else {
|
||||
$("#changesToPushCount").html(resp.changesToPushCount);
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
401: () => {
|
||||
// if the user got logged out then we should display the page
|
||||
// here we do that by reloading which will force the redirect if the user is really logged out
|
||||
window.location.reload(true);
|
||||
},
|
||||
409: () => {
|
||||
// 409 means we need to migrate database, reload will take care of it
|
||||
window.location.reload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(checkStatus, 10 * 1000);
|
||||
@@ -4,7 +4,7 @@ function syncNow() {
|
||||
type: 'POST',
|
||||
success: result => {
|
||||
if (result.success) {
|
||||
checkAudit();
|
||||
checkStatus();
|
||||
|
||||
message("Sync finished successfully");
|
||||
|
||||
|
||||
@@ -88,31 +88,6 @@ let globalEncryptionSessionTimeout;
|
||||
let globalEncryptedDataKey;
|
||||
let globalFullLoadTime;
|
||||
|
||||
function checkAudit() {
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'audit/' + globalFullLoadTime,
|
||||
type: 'GET',
|
||||
success: resp => {
|
||||
if (resp.changed) {
|
||||
window.location.reload(true);
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
401: () => {
|
||||
// if the user got logged out then we should display the page
|
||||
// here we do that by reloading which will force the redirect if the user is really logged out
|
||||
window.location.reload(true);
|
||||
},
|
||||
409: () => {
|
||||
// 409 means we need to migrate database, reload will take care of it
|
||||
window.location.reload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(checkAudit, 10 * 1000);
|
||||
|
||||
$(() => {
|
||||
$.get(baseApiUrl + 'tree').then(resp => {
|
||||
const notes = resp.notes;
|
||||
|
||||
Reference in New Issue
Block a user