From 28dcdc89847d2c422ed0dff362098786dfa95851 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 3 Nov 2017 18:51:13 +0000 Subject: [PATCH] Fixed switching of locale --- README.md | 1 + ReactNativeClient/lib/registry.js | 7 ++++++- ReactNativeClient/root.js | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 617ff5837..0d945502b 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,7 @@ The following commands are available in [command-line mode](#command-line-mode): # Known bugs - Non-alphabetical characters such as Chinese or Arabic might create glitches in the user interface on Windows. This is a limitation of the current Windows console. +- In the React Native app, changing the notebook of a note sometimes has no effect, due to [this bug](https://github.com/facebook/react-native/issues/15556). # License diff --git a/ReactNativeClient/lib/registry.js b/ReactNativeClient/lib/registry.js index 94f747b96..38cc69fe6 100644 --- a/ReactNativeClient/lib/registry.js +++ b/ReactNativeClient/lib/registry.js @@ -138,7 +138,7 @@ reg.syncHasAuth = (syncTargetId) => { } reg.scheduleSync = async (delay = null) => { - if (delay === null) delay = 1000 * 10; + if (delay === null) delay = 1000 * 3; if (reg.scheduleSyncId_) { clearTimeout(reg.scheduleSyncId_); @@ -147,6 +147,11 @@ reg.scheduleSync = async (delay = null) => { reg.logger().info('Scheduling sync operation...'); + // if (Setting.value('env') === 'dev') { + // reg.logger().info('Scheduling sync operation DISABLED!!!'); + // return; + // } + const timeoutCallback = async () => { reg.scheduleSyncId_ = null; reg.logger().info('Doing scheduled sync'); diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index a3681586d..e36eeb7d0 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -54,6 +54,10 @@ const generalMiddleware = store => next => async (action) => { reg.setupRecurrentSync(); } + if (action.type == 'SETTINGS_UPDATE_ONE' && action.key == 'locale' || action.type == 'SETTINGS_UPDATE_ALL') { + setLocale(Setting.value('locale')); + } + if (action.type == 'NAV_GO' && action.routeName == 'Notes') { Setting.setValue('activeFolderId', newState.selectedFolderId); }