Skip to content

Commit

Permalink
Merge branch '@chrispader/update-onyx-1.0.54' of github.com:margelo/e…
Browse files Browse the repository at this point in the history
…xpensify-app-fork into perf/onyx-upgrade-use-cache-directly
  • Loading branch information
hannojg committed Jul 27, 2023
2 parents 568a2ca + 660470f commit 4e3de64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/QueuedOnyxUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Onyx.connect({
* @returns {Promise}
*/
function queueOnyxUpdates(updates) {
return Onyx.merge(ONYXKEYS.QUEUED_ONYX_UPDATES, updates);
return Onyx.set(ONYXKEYS.QUEUED_ONYX_UPDATES, [...queuedOnyxUpdates, ...updates]);
}

function clear() {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/EmojiTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('EmojiTest', () => {
lastUpdatedAt: 1,
},
];
Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);
Onyx.set(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);

return waitForPromisesToResolve().then(() => {
// When add a new emoji
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('EmojiTest', () => {
},
{...smileEmoji, count: 1, lastUpdatedAt: 1},
];
Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);
Onyx.set(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);

return waitForPromisesToResolve().then(() => {
// When add multiple emojis that either exist or not exist in the list
Expand Down Expand Up @@ -464,7 +464,7 @@ describe('EmojiTest', () => {
{...bookEmoji, count: 3, lastUpdatedAt: 1},
];
expect(frequentlyEmojisList.length).toBe(CONST.EMOJI_FREQUENT_ROW_COUNT * CONST.EMOJI_NUM_PER_ROW);
Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);
Onyx.set(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList);

return waitForPromisesToResolve().then(() => {
// When add new emojis
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/SidebarOrderTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ describe('Sidebar', () => {
})

// When the draft is removed
.then(() => Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, {hasDraft: null}))

.then(() => Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, {hasDraft: false}))
// Then the pencil icon goes away
.then(() => {
expect(screen.queryAllByTestId('Pencil Icon')).toHaveLength(0);
Expand Down

0 comments on commit 4e3de64

Please sign in to comment.