From 95c39ac875b7dda792057884d0901b9caad7c740 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 26 Jan 2019 18:28:13 +0100 Subject: Reworked database and async methods --- public/scripts/chat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'public/scripts/chat.js') diff --git a/public/scripts/chat.js b/public/scripts/chat.js index e81bd44..01377bf 100644 --- a/public/scripts/chat.js +++ b/public/scripts/chat.js @@ -8,12 +8,12 @@ const peerId = nanoid(); // setup encryption (async () => { - if (localStorage.getItem('database') === 'success' && encryption.setupConn() && await encryption.check()) { + encryption.setup(); + if (localStorage.getItem('database') === 'success' && await encryption.check()) { // TODO: Ask for passphrase chat(); } else { console.log('[LOG] No existing keys found! Generating...'); - encryption.setup(); (async () => await encryption.generate(peerId, 'supersecure').then(() => chat()))() } })(); -- cgit v1.2.3