Skip to content

Commit 455e801

Browse files
authored
Merge pull request Expensify#67537 from DylanDylann/Refactor-Download-file-to-remove-onyx-connect
[No QA]: Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.DOWNLOAD in src/libs/actions/Download.ts
2 parents 4515ef6 + 7fdcfd4 commit 455e801

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/libs/actions/Download.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function setDownload(sourceID: string, isDownloading: boolean): Promise<void | v
99
}
1010

1111
function clearDownloads() {
12-
const connection = Onyx.connect({
12+
// Use connectWithoutView to access Onyx data for clearing downloads
13+
// without triggering UI updates or component re-renders.
14+
const connection = Onyx.connectWithoutView({
1315
key: ONYXKEYS.COLLECTION.DOWNLOAD,
1416
waitForCollectionCallback: true,
1517
callback: (records) => {

0 commit comments

Comments
 (0)