Skip to content

Commit

Permalink
Merge pull request #477 from Expensify/revert-470-fix/falsey-value-is…
Browse files Browse the repository at this point in the history
…-ignored
  • Loading branch information
blimpich authored Feb 27, 2024
2 parents c9f22a3 + 23a2fd8 commit f816652
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion lib/withOnyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function (mapOnyxToState, shouldDelayUpdates = false) {
(resultObj, mapping, propertyName) => {
const key = Str.result(mapping.key, props);
let value = Onyx.tryGetCachedValue(key, mapping);
if (value === undefined) {
if (!value && mapping.initialValue) {
value = mapping.initialValue;
}

Expand Down
5 changes: 0 additions & 5 deletions tests/unit/withOnyxTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,6 @@ describe('withOnyxTest', () => {
key: ONYX_KEYS.SIMPLE_KEY,
initialValue: 'initialValue',
},
simple2: {
key: ONYX_KEYS.SIMPLE_KEY_2,
initialValue: false,
},
})(ViewWithCollections);
render(
<TestComponentWithOnyx
Expand All @@ -582,7 +578,6 @@ describe('withOnyxTest', () => {
onRender,
testObject: {isDefaultProp: true},
simple: 'initialValue',
simple2: false,
});
});
});
Expand Down

0 comments on commit f816652

Please sign in to comment.