basic conflict detection based on the audit log

This commit is contained in:
azivner
2017-09-29 00:17:28 -04:00
parent a9698d362f
commit ff58456332
4 changed files with 33 additions and 0 deletions
+10
View File
@@ -86,6 +86,15 @@ function setExpandedToServer(note_id, is_expanded) {
let globalEncryptionSalt;
let globalEncryptionSessionTimeout;
let globalEncryptedDataKey;
let globalFullLoadTime;
setInterval(() => {
$.get(baseUrl + 'audit/' + globalFullLoadTime).then(resp => {
if (resp.changed) {
window.location.reload(true);
}
});
}, 60 * 1000);
$(function(){
$.get(baseUrl + 'tree').then(resp => {
@@ -94,6 +103,7 @@ $(function(){
globalEncryptionSalt = resp.password_derived_key_salt;
globalEncryptionSessionTimeout = resp.encryption_session_timeout;
globalEncryptedDataKey = resp.encrypted_data_key;
globalFullLoadTime = resp.full_load_time;
// add browser ID header to all AJAX requests
$.ajaxSetup({