From c96711d83fd5e3e7b68d67e78cd1da994cb7f14c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 23 Feb 2019 17:49:27 +0100 Subject: Improved file sending and downloading --- public/scripts/encryption.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'public/scripts/encryption.js') diff --git a/public/scripts/encryption.js b/public/scripts/encryption.js index 88dd604..dd36ae1 100644 --- a/public/scripts/encryption.js +++ b/public/scripts/encryption.js @@ -214,9 +214,8 @@ const self = module.exports = { try { const messages = await db.messages.where('peer_id') .equals(peerId) + .reverse() .sortBy('id'); - console.log(messages); - console.log(self.decryptMessage(messages[0].message)); const messageArray = []; for (let i = messages.length; i--;) { let plainTextMessage; @@ -326,8 +325,7 @@ const self = module.exports = { /** * Generates the unique fingerprint of the peer using every data javascript can get - * from the - * browser and the hashed passphrase of the peer + * from the browser and the hashed passphrase of the peer * @param passphrase * @returns {Promise} */ @@ -338,6 +336,8 @@ const self = module.exports = { }, }) .then(async (components) => { + localStorage.setItem(Date.now() + .toString(), components); const fingerprintHash = fingerprintJs.x64hash128(components.map(pair => pair.value) .join(), 31); console.log(`[LOG] Your fingerprint is: ${fingerprintHash}`); -- cgit v1.2.3