From c8c513d70f91491c45f47495f66dab653471628a Mon Sep 17 00:00:00 2001 From: allgandalf Date: Sat, 23 Aug 2025 02:08:42 +0530 Subject: [PATCH] fix ONYXKEYS.ACCOUNT --- package.json | 2 +- src/libs/Network/enhanceParameters.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 801341ed68bb..68695cac4b7d 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=244 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=243 --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/Network/enhanceParameters.ts b/src/libs/Network/enhanceParameters.ts index d94d6aeddaf0..d34778fe0775 100644 --- a/src/libs/Network/enhanceParameters.ts +++ b/src/libs/Network/enhanceParameters.ts @@ -22,7 +22,9 @@ Onyx.connect({ // Check if the user is logged in as a delegate and send that if so let delegate = ''; -Onyx.connect({ +// To enhance the API parameters, we do not need to depend on the UI, +// so it is okay to use `connectWithoutView` here. +Onyx.connectWithoutView({ key: ONYXKEYS.ACCOUNT, callback: (val) => { delegate = val?.delegatedAccess?.delegate ?? '';