Skip to content

Commit fe4c82f

Browse files
committed
Refactor CachedPDFPaths connection to use connectWithoutView
1 parent 9ec1076 commit fe4c82f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/libs/actions/CachedPDFPaths/index.native.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import type {Add, Clear, ClearByKey} from './types';
88
* This is to remove the cached PDFs when an attachment is deleted or the user logs out.
99
*/
1010
let pdfPaths: Record<string, string> = {};
11-
Onyx.connect({
11+
// We use `connectWithoutView` here since this connection only updates a module-level variable
12+
// and doesn't need to trigger component re-renders
13+
Onyx.connectWithoutView({
1214
key: ONYXKEYS.CACHED_PDF_PATHS,
1315
callback: (val) => {
1416
pdfPaths = val ?? {};

0 commit comments

Comments
 (0)