number of sync changes to push next to "sync now" button

This commit is contained in:
azivner
2017-11-01 20:31:44 -04:00
parent 72905a9854
commit 962c078bbc
8 changed files with 58 additions and 38 deletions
+27
View File
@@ -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);
+1 -1
View File
@@ -4,7 +4,7 @@ function syncNow() {
type: 'POST',
success: result => {
if (result.success) {
checkAudit();
checkStatus();
message("Sync finished successfully");
-25
View File
@@ -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;