mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-25 02:10:32 -06:00
SEARCH-273
- Changed the encryption to async - Logged decryption time
This commit is contained in:
parent
0f18b17cf0
commit
ab963f4567
@ -200,7 +200,9 @@
|
||||
|
||||
merge.addEventListener('click', function () {
|
||||
search.mergeIndexBatches().then(function () {
|
||||
search.encryptIndex();
|
||||
search.encryptIndex().then(function () {
|
||||
resultsEl.innerHTML = "Merging and Encrypting index completed"
|
||||
});
|
||||
}).catch(function (err) {
|
||||
resultsEl.innerHTML = 'Error: ' + err;
|
||||
});
|
||||
|
@ -54,6 +54,7 @@ class Search {
|
||||
* @param key
|
||||
*/
|
||||
constructor(userId, key) {
|
||||
console.time('Decrypting');
|
||||
this.isInitialized = false;
|
||||
this.userId = userId;
|
||||
this.key = key;
|
||||
@ -68,6 +69,7 @@ class Search {
|
||||
|
||||
decryptAndInit() {
|
||||
this.crypto.decryption().then(() => {
|
||||
console.timeEnd('Decrypting');
|
||||
this.init();
|
||||
}).catch(() => {
|
||||
this.init();
|
||||
@ -206,10 +208,10 @@ class Search {
|
||||
* to the main user index
|
||||
*/
|
||||
encryptIndex() {
|
||||
this.crypto.encryption().then(() => {
|
||||
return this.crypto.encryption().then(() => {
|
||||
return 'Success'
|
||||
}).catch((e) => {
|
||||
throw new Error(e)
|
||||
return (new Error(e));
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user