Skip to content

Commit

Permalink
add backTo as dependency
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
twilight2294 authored Oct 14, 2024
1 parent 7e497a6 commit 39130e3
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/CategoryGLCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function CategoryGLCodePage({route}: EditCategoryPageProps) {
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, categoryName),
);
},
[categoryName, glCode, route.params.policyID, isQuickSettingsFlow],
[categoryName, glCode, route.params.policyID, isQuickSettingsFlow, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/CategoryPayrollCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function CategoryPayrollCodePage({route}: EditCategoryPageProps) {
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, categoryName),
);
},
[categoryName, payrollCode, route.params.policyID, isQuickSettingsFlow],
[categoryName, payrollCode, route.params.policyID, isQuickSettingsFlow, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/CreateCategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function CreateCategoryPage({route}: CreateCategoryPageProps) {
Category.createPolicyCategory(route.params.policyID, values.categoryName.trim());
Navigation.goBack(isQuickSettingsFlow ? ROUTES.SETTINGS_CATEGORIES_ROOT.getRoute(route.params.policyID, backTo) : undefined);
},
[isQuickSettingsFlow, route.params.policyID],
[isQuickSettingsFlow, route.params.policyID, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/EditCategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function EditCategoryPage({route}: EditCategoryPageProps) {
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, route.params.categoryName),
);
},
[isQuickSettingsFlow, currentCategoryName, route.params.categoryName, route.params.policyID],
[isQuickSettingsFlow, currentCategoryName, route.params.categoryName, route.params.policyID, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
}

return menuItems;
}, [policyId, translate, isOffline, hasVisibleCategories, policy, isQuickSettingsFlow]);
}, [policyId, translate, isOffline, hasVisibleCategories, policy, isQuickSettingsFlow, backTo]);

const selectionModeHeader = selectionMode?.isEnabled && shouldUseNarrowLayout;

Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/EditTagPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function EditTagPage({route}: EditTagPageProps) {

return errors;
},
[policyTags, route.params.orderWeight, currentTagName, translate],
[policyTags, route.params.orderWeight, currentTagName, translate, backTo],

Check warning on line 54 in src/pages/workspace/tags/EditTagPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has an unnecessary dependency: 'backTo'. Either exclude it or remove the dependency array
);

const editTag = useCallback(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/TagGLCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function TagGLCodePage({route}: EditTagGLCodePageProps) {
? ROUTES.SETTINGS_TAG_SETTINGS.getRoute(route.params.policyID, orderWeight, tagName, backTo)
: ROUTES.WORKSPACE_TAG_SETTINGS.getRoute(route.params.policyID, orderWeight, tagName),
);
}, [orderWeight, route.params.policyID, tagName, isQuickSettingsFlow]);
}, [orderWeight, route.params.policyID, tagName, isQuickSettingsFlow, backTo]);

const editGLCode = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_TAG_FORM>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/WorkspaceCreateTagPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function CreateTagPage({route}: CreateTagPageProps) {
Keyboard.dismiss();
Navigation.goBack(isQuickSettingsFlow ? ROUTES.SETTINGS_TAGS_ROOT.getRoute(route.params.policyID, backTo) : undefined);
},
[route.params.policyID, isQuickSettingsFlow],
[route.params.policyID, isQuickSettingsFlow, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/WorkspaceEditTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function WorkspaceEditTagsPage({route}: WorkspaceEditTagsPageProps) {
isQuickSettingsFlow ? ROUTES.SETTINGS_TAGS_SETTINGS.getRoute(route?.params?.policyID, backTo) : ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(route?.params?.policyID),
);
},
[policyTags, route.params.orderWeight, route.params.policyID, taglistName, isQuickSettingsFlow],
[policyTags, route.params.orderWeight, route.params.policyID, taglistName, isQuickSettingsFlow, backTo],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
}

return menuItems;
}, [translate, hasVisibleTags, isOffline, policyID, isQuickSettingsFlow]);
}, [translate, hasVisibleTags, isOffline, policyID, isQuickSettingsFlow, backTo]);

const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
Expand Down

0 comments on commit 39130e3

Please sign in to comment.