Skip to content

Commit 198d552

Browse files
authored
Merge pull request Expensify#67538 from DylanDylann/Refactor-device-file-to-remove-onyx-connect
[No QA]: Remove Onyx.connect() for the key: ONYXKEYS.DEVICE_ID in src/libs/actions/Device/index.ts Expensify#66501
2 parents f9e9ce0 + ce02586 commit 198d552

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/libs/actions/Device/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function getDeviceID(): Promise<string | null> {
1616
return;
1717
}
1818

19-
const connection = Onyx.connect({
19+
// Use connectWithoutView because this is a one-time data fetch that disconnects immediately without triggering UI updates
20+
// and this onyx key is created for non-UI task only.
21+
const connection = Onyx.connectWithoutView({
2022
key: ONYXKEYS.DEVICE_ID,
2123
callback: (id) => {
2224
Onyx.disconnect(connection);

tests/unit/ReportUtilsGetIconsTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('getIcons', () => {
148148
it('should return the correct icons for archived non expense request/report', () => {
149149
const report: Report = {
150150
...LHNTestUtils.getFakeReport([1], 0, true),
151-
type: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT,
151+
type: CONST.REPORT.CHAT_TYPE.INVOICE,
152152
};
153153
const policy = LHNTestUtils.getFakePolicy('1');
154154

0 commit comments

Comments
 (0)