From 38c0c53a6911eeb9222fbd95fff655e44f93b265 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 17 Jul 2020 14:22:24 +1000 Subject: [PATCH 1/2] Fix app start with password set by requiring only what is needed in the signal.js loaded by password_preload.js --- js/modules/signal_password.js | 15 +++++++++++++++ password_preload.js | 4 +--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 js/modules/signal_password.js diff --git a/js/modules/signal_password.js b/js/modules/signal_password.js new file mode 100644 index 000000000..64e6b551e --- /dev/null +++ b/js/modules/signal_password.js @@ -0,0 +1,15 @@ +// The idea with this file is to make it webpackable for the style guide + +const { + SessionPasswordPrompt, +} = require('../../ts/components/session/SessionPasswordPrompt'); + +exports.setup = () => { + const Components = { + SessionPasswordPrompt, + }; + + return { + Components, + }; +}; diff --git a/password_preload.js b/password_preload.js index e0cc712ef..04a8a2001 100644 --- a/password_preload.js +++ b/password_preload.js @@ -22,7 +22,7 @@ window.getVersion = () => config.version; window.getAppInstance = () => config.appInstance; // So far we're only using this for Signal.Types -const Signal = require('./js/modules/signal'); +const Signal = require('./js/modules/signal_password'); const electron = require('electron'); const ipc = electron.ipcRenderer; @@ -33,8 +33,6 @@ window.Signal = Signal.setup({ getRegionCode: () => null, }); -window.Signal.Logs = require('./js/modules/logs'); - window.CONSTANTS = { MAX_LOGIN_TRIES: 3, MAX_PASSWORD_LENGTH: 64, From 30964e5008b2fe22f6033bb3c77dab8625200a76 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 17 Jul 2020 14:33:32 +1000 Subject: [PATCH 2/2] load SessionPasswordPrompt directly from password_preload.js --- js/modules/signal_password.js | 15 --------------- password_preload.js | 17 +++++++++-------- 2 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 js/modules/signal_password.js diff --git a/js/modules/signal_password.js b/js/modules/signal_password.js deleted file mode 100644 index 64e6b551e..000000000 --- a/js/modules/signal_password.js +++ /dev/null @@ -1,15 +0,0 @@ -// The idea with this file is to make it webpackable for the style guide - -const { - SessionPasswordPrompt, -} = require('../../ts/components/session/SessionPasswordPrompt'); - -exports.setup = () => { - const Components = { - SessionPasswordPrompt, - }; - - return { - Components, - }; -}; diff --git a/password_preload.js b/password_preload.js index 04a8a2001..d499b1609 100644 --- a/password_preload.js +++ b/password_preload.js @@ -21,17 +21,18 @@ window.getEnvironment = () => config.environment; window.getVersion = () => config.version; window.getAppInstance = () => config.appInstance; -// So far we're only using this for Signal.Types -const Signal = require('./js/modules/signal_password'); const electron = require('electron'); const ipc = electron.ipcRenderer; - -window.Signal = Signal.setup({ - Attachments: null, - userDataPath: null, - getRegionCode: () => null, -}); +const { + SessionPasswordPrompt, +} = require('./ts/components/session/SessionPasswordPrompt'); + +window.Signal = { + Components: { + SessionPasswordPrompt, + }, +} window.CONSTANTS = { MAX_LOGIN_TRIES: 3,