Skip to content

Commit

Permalink
fix(web): do-not-reset-list-and-item-creation-when-reading-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Harman-singh-waraich committed Nov 5, 2024
1 parent d71993d commit 06af22f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/context/SubmitItemContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const SubmitItemProvider: React.FC<{ children: React.ReactNode }> = ({ ch

useEffect(() => {
// Cleanup function to clear local storage when user leaves the route
if (location.pathname.includes("/submit-item")) return;
if (location.pathname.includes("/submit-item") || location.pathname.includes("/attachment")) return;

resetItemData();
}, [location.pathname]);
Expand Down
2 changes: 1 addition & 1 deletion web/src/context/SubmitListContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const SubmitListProvider: React.FC<{ children: React.ReactNode }> = ({ ch

useEffect(() => {
// Cleanup function to clear local storage when user leaves the route
if (location.pathname.includes("/submit-list")) return;
if (location.pathname.includes("/submit-list") || location.pathname.includes("/attachment")) return;

resetListData();
}, [location.pathname]);
Expand Down

0 comments on commit 06af22f

Please sign in to comment.