Skip to content

Commit

Permalink
Merge pull request #29700 from AmjedNazzal/Issue28942
Browse files Browse the repository at this point in the history
Fix - Rate - When Rate is changed in offline mode red dot appear back online #28942
  • Loading branch information
mountiny authored Oct 17, 2023
2 parents 8917f95 + 55b10d3 commit c197a97
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Onyx.connect({
callback: (val) => (allRecentlyUsedCategories = val),
});

let networkStatus = {};
Onyx.connect({
key: ONYXKEYS.NETWORK,
waitForCollectionCallback: true,
callback: (val) => (networkStatus = val),
});

/**
* Stores in Onyx the policy ID of the last workspace that was accessed by the user
* @param {String|null} policyID
Expand Down Expand Up @@ -766,7 +773,7 @@ function updateWorkspaceCustomUnitAndRate(policyID, currentCustomUnit, newCustom
'UpdateWorkspaceCustomUnitAndRate',
{
policyID,
lastModified,
...(!networkStatus.isOffline && {lastModified}),
customUnit: JSON.stringify(newCustomUnitParam),
customUnitRate: JSON.stringify(newCustomUnitParam.rates),
},
Expand Down

0 comments on commit c197a97

Please sign in to comment.