From 959a8b59d1e7fd85de6d1f25b3f692c7dae2e255 Mon Sep 17 00:00:00 2001 From: Roman Musin Date: Thu, 4 Jun 2020 21:56:43 +0100 Subject: [PATCH] Initialize keychain service when starting mobile app --- ReactNativeClient/root.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index d14a25515..2dcf69760 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -65,6 +65,9 @@ const WelcomeUtils = require('lib/WelcomeUtils'); const { themeStyle } = require('lib/components/global-style.js'); const { uuid } = require('lib/uuid.js'); +const { loadKeychainServiceAndSettings } = require('lib/services/SettingUtils'); +const KeychainServiceDriverMobile = require('lib/services/keychain/KeychainServiceDriver.mobile').default; + const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); const SyncTargetOneDrive = require('lib/SyncTargetOneDrive.js'); const SyncTargetFilesystem = require('lib/SyncTargetFilesystem.js'); @@ -444,7 +447,8 @@ async function initialize(dispatch) { reg.logger().info('Database is ready.'); reg.logger().info('Loading settings...'); - await Setting.load(); + + await loadKeychainServiceAndSettings(KeychainServiceDriverMobile); if (!Setting.value('clientId')) Setting.setValue('clientId', uuid.create());