mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-07 21:39:48 -06:00
encryption settings loading moved from tree to encryption module
This commit is contained in:
@@ -12,6 +12,16 @@ const encryption = (function() {
|
||||
let encryptedDataKey = null;
|
||||
let encryptionSessionTimeout = null;
|
||||
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'settings/all',
|
||||
type: 'GET',
|
||||
error: () => error("Error getting encryption settings.")
|
||||
}).then(settings => {
|
||||
encryptionSalt = settings.password_derived_key_salt;
|
||||
encryptionSessionTimeout = settings.encryption_session_timeout;
|
||||
encryptedDataKey = settings.encrypted_data_key;
|
||||
});
|
||||
|
||||
function setEncryptionSalt(encSalt) {
|
||||
encryptionSalt = encSalt;
|
||||
}
|
||||
@@ -438,7 +448,6 @@ const encryption = (function() {
|
||||
}
|
||||
|
||||
return {
|
||||
setEncryptionSalt,
|
||||
setEncryptedDataKey,
|
||||
setEncryptionSessionTimeout,
|
||||
ensureEncryptionIsAvailable,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const glob = {
|
||||
allNoteIds: [],
|
||||
activeDialog: null
|
||||
};
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ const noteTree = (function() {
|
||||
let treeLoadTime = null;
|
||||
let clipboardNoteId = null;
|
||||
|
||||
glob.allNoteIds = [];
|
||||
|
||||
function getTreeLoadTime() {
|
||||
return treeLoadTime;
|
||||
}
|
||||
@@ -194,9 +192,6 @@ const noteTree = (function() {
|
||||
return $.get(baseApiUrl + 'tree').then(resp => {
|
||||
const notes = resp.notes;
|
||||
let startNoteId = resp.start_note_id;
|
||||
encryption.setEncryptionSalt(resp.password_derived_key_salt);
|
||||
encryption.setEncryptionSessionTimeout(resp.encryption_session_timeout);
|
||||
encryption.setEncryptedDataKey(resp.encrypted_data_key);
|
||||
treeLoadTime = resp.tree_load_time;
|
||||
|
||||
// add browser ID header to all AJAX requests
|
||||
|
||||
Reference in New Issue
Block a user