From 38c0c53a6911eeb9222fbd95fff655e44f93b265 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 17 Jul 2020 14:22:24 +1000 Subject: [PATCH] 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,