mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	fix: Explorer Page State Not Working On Hitting Back (#6171)
This commit is contained in:
		| @@ -121,7 +121,7 @@ | |||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import RecipeExplorerPageSearchFilters from "./RecipeExplorerPageSearchFilters.vue"; | import RecipeExplorerPageSearchFilters from "./RecipeExplorerPageSearchFilters.vue"; | ||||||
| import { useRecipeExplorerSearch } from "~/composables/use-recipe-explorer-search"; | import { useRecipeExplorerSearch, clearRecipeExplorerSearchState } from "~/composables/use-recipe-explorer-search"; | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   ready: []; |   ready: []; | ||||||
| @@ -155,6 +155,11 @@ onMounted(async () => { | |||||||
|   emit("ready"); |   emit("ready"); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | onUnmounted(() => { | ||||||
|  |   // Clear the cache when component unmounts to ensure fresh state on remount | ||||||
|  |   clearRecipeExplorerSearchState(groupSlug.value); | ||||||
|  | }); | ||||||
|  |  | ||||||
| const sortText = computed(() => { | const sortText = computed(() => { | ||||||
|   const sort = sortable.value.find(s => s.value === state.value.orderBy); |   const sort = sortable.value.find(s => s.value === state.value.orderBy); | ||||||
|   if (!sort) return ""; |   if (!sort) return ""; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user