Skip to content

Commit

Permalink
Rename onyx key
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolen committed Aug 11, 2023
1 parent 7934f37 commit 636f26c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default {
IS_USING_MEMORY_ONLY_KEYS: 'isUsingMemoryOnlyKeys',

// Information about the onyx updates IDs that were received from the server
ONYX_UPDATES: 'onyxUpdates',
ONYX_UPDATES_FROM_SERVER: 'onyxUpdatesFromServer',

// The last update ID that was applied to the client
ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT: 'OnyxUpdatesLastUpdateIDAppliedToClient',
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ function getMissingOnyxUpdates(updateIDFrom = 0, updateIDTo = 0) {
// The next 40ish lines of code are used for detecting when there is a gap of OnyxUpdates between what was last applied to the client and the updates the server has.
// When a gap is detected, the missing updates are fetched from the API.

// These key needs to be separate from ONYXKEYS.ONYX_UPDATES so that it can be updated without triggering the callback when the server IDs are updated
// These key needs to be separate from ONYXKEYS.ONYX_UPDATES_FROM_SERVER so that it can be updated without triggering the callback when the server IDs are updated
let lastUpdateIDAppliedToClient = 0;
Onyx.connect({
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
callback: (val) => (lastUpdateIDAppliedToClient = val),
});

Onyx.connect({
key: ONYXKEYS.ONYX_UPDATES,
key: ONYXKEYS.ONYX_UPDATES_FROM_SERVER,
callback: (val) => {
if (!val) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/OnyxUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function saveUpdateIDs(lastUpdateID = 0, previousUpdateID = 0) {
return;
}

Onyx.merge(ONYXKEYS.ONYX_UPDATES, {
Onyx.merge(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, {
lastUpdateIDFromServer: lastUpdateID,
previousUpdateIDFromServer: previousUpdateID,
});
Expand Down

0 comments on commit 636f26c

Please sign in to comment.