Skip to content

Commit b883a4c

Browse files
committed
Skip nullish values when merging the OldDot transition payload
1 parent 88b594f commit b883a4c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/libs/actions/Session/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,17 @@ function setupNewDotAfterTransitionFromOldDot(hybridAppSettings: HybridAppSettin
793793
];
794794

795795
for (const [key, value] of Object.entries(newDotOnyxValues)) {
796+
// `?? {}` used to stand in for a missing value, but these keys are not all objects —
797+
// merging `{}` into SHOULD_USE_STAGING_SERVER leaves a truthy non-boolean behind. There is
798+
// nothing to apply when OldDot sends nothing, so skip the key instead.
799+
if (value === undefined || value === null) {
800+
continue;
801+
}
802+
796803
onyxUpdates.push({
797804
onyxMethod: Onyx.METHOD.MERGE,
798805
key,
799-
value: value ?? {},
806+
value,
800807
} as OnyxUpdate<keyof typeof newDotOnyxValues>);
801808
}
802809

0 commit comments

Comments
 (0)