From 6d7ff654db9558a923d7e4119566c2e3ff6b0aa8 Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Thu, 31 Jul 2025 17:33:38 +0700 Subject: [PATCH 1/2] remove onyx.connect --- src/libs/actions/Locale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Locale.ts b/src/libs/actions/Locale.ts index 19283e61f3a6..4209f544a7bd 100644 --- a/src/libs/actions/Locale.ts +++ b/src/libs/actions/Locale.ts @@ -8,7 +8,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; * This function is used to ensure that the locale is loaded before we start to render UI. Once we load initial locale we can remove listener. */ function init() { - const connection = Onyx.connect({ + const connection = Onyx.connectWithoutView({ key: ONYXKEYS.NVP_PREFERRED_LOCALE, initWithStoredValues: true, callback: (locale) => { From 9dcaa8edaf296f1b9cf496ef78cd4c99e17adc72 Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Fri, 1 Aug 2025 12:19:21 +0700 Subject: [PATCH 2/2] add comment --- package.json | 2 +- src/libs/actions/Locale.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 726f2e510739..59baaa27baf7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand", "perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure", "typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc", - "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=331 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=330 --cache --cache-location=node_modules/.cache/eslint", "lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", diff --git a/src/libs/actions/Locale.ts b/src/libs/actions/Locale.ts index 4209f544a7bd..b33f0ac95a10 100644 --- a/src/libs/actions/Locale.ts +++ b/src/libs/actions/Locale.ts @@ -8,6 +8,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; * This function is used to ensure that the locale is loaded before we start to render UI. Once we load initial locale we can remove listener. */ function init() { + // Use connectWithoutView since this is a one-time initialization that disconnects immediately. const connection = Onyx.connectWithoutView({ key: ONYXKEYS.NVP_PREFERRED_LOCALE, initWithStoredValues: true,