Skip to content

Commit

Permalink
Merge pull request #54239 from wildan-m/wildan/fix/50078-fix-old-data…
Browse files Browse the repository at this point in the history
…-briefly-appeared

Fix: Android - Category - "Default tax rate" briefly changes back to the default one
  • Loading branch information
arosiclair authored Dec 18, 2024
2 parents 9cc0012 + 42bfab2 commit 0ad4b2b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/pages/workspace/categories/EditCategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ function EditCategoryPage({route}: EditCategoryPageProps) {
if (currentCategoryName !== newCategoryName) {
Category.renamePolicyCategory(route.params.policyID, {oldName: currentCategoryName, newName: values.categoryName});
}
Navigation.goBack(
isQuickSettingsFlow
? ROUTES.SETTINGS_CATEGORY_SETTINGS.getRoute(route.params.policyID, route.params.categoryName, backTo)
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, route.params.categoryName),
);

// Ensure Onyx.update is executed before navigation to prevent UI blinking issues, affecting the category name and rate.
Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.goBack(
isQuickSettingsFlow
? ROUTES.SETTINGS_CATEGORY_SETTINGS.getRoute(route.params.policyID, route.params.categoryName, backTo)
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, route.params.categoryName),
);
});
},
[isQuickSettingsFlow, currentCategoryName, route.params.categoryName, route.params.policyID, backTo],
);
Expand Down

0 comments on commit 0ad4b2b

Please sign in to comment.