Skip to content

Commit db2c140

Browse files
fix: Explorer Page State Not Working On Hitting Back (#6171)
1 parent 9a0525c commit db2c140

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/components/Domain/Recipe/RecipeExplorerPage/RecipeExplorerPageParts/RecipeExplorerPageSearch.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121

122122
<script setup lang="ts">
123123
import RecipeExplorerPageSearchFilters from "./RecipeExplorerPageSearchFilters.vue";
124-
import { useRecipeExplorerSearch } from "~/composables/use-recipe-explorer-search";
124+
import { useRecipeExplorerSearch, clearRecipeExplorerSearchState } from "~/composables/use-recipe-explorer-search";
125125
126126
const emit = defineEmits<{
127127
ready: [];
@@ -155,6 +155,11 @@ onMounted(async () => {
155155
emit("ready");
156156
});
157157
158+
onUnmounted(() => {
159+
// Clear the cache when component unmounts to ensure fresh state on remount
160+
clearRecipeExplorerSearchState(groupSlug.value);
161+
});
162+
158163
const sortText = computed(() => {
159164
const sort = sortable.value.find(s => s.value === state.value.orderBy);
160165
if (!sort) return "";

0 commit comments

Comments
 (0)