Skip to content

Commit 0ab6c73

Browse files
authored
chore: use explicit !== undefined check instead of truthy check (@ennajari) (#7805)
## Summary - Use explicit `!== undefined` check instead of truthy check for cached `Promise` in memoize utility (`json-data.ts`) ## Test plan - [ ] Memoized async functions cache correctly
1 parent 74ae09e commit 0ab6c73

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ frontend/static/webfonts-preview
132132
.turbo
133133
frontend/.env.sentry-build-plugin
134134
.claude/worktrees
135-
1024MiB
135+
1024MiB

frontend/src/ts/utils/json-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function memoizeAsync<P, Args extends unknown[], R>(
5252
const key = getKey ? getKey(...args) : (args[0] as P);
5353

5454
const cached = cache.get(key);
55-
if (cached) {
55+
if (cached !== undefined) {
5656
return cached;
5757
}
5858

0 commit comments

Comments
 (0)