mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 18:53:17 -05:00 
			
		
		
		
	fix: Recipe Search URL State (#3332)
* fix several state issues with explore page - update state when there are no query params - only call search if the query params actually changed - wait until ready to call API * store last search query in user prefs * restore chip tag click to anonymous user
This commit is contained in:
		@@ -9,7 +9,7 @@
 | 
			
		||||
      color="accent"
 | 
			
		||||
      :small="small"
 | 
			
		||||
      dark
 | 
			
		||||
      :to="isOwnGroup ? `${baseRecipeRoute}?${urlPrefix}=${category.id}` : undefined"
 | 
			
		||||
      :to="`${baseRecipeRoute}?${urlPrefix}=${category.id}`"
 | 
			
		||||
    >
 | 
			
		||||
      {{ truncateText(category.name) }}
 | 
			
		||||
    </v-chip>
 | 
			
		||||
@@ -18,7 +18,6 @@
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { computed, defineComponent, useContext, useRoute } from "@nuxtjs/composition-api";
 | 
			
		||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
 | 
			
		||||
import { RecipeCategory, RecipeTag, RecipeTool } from "~/lib/api/types/user";
 | 
			
		||||
 | 
			
		||||
export type UrlPrefixParam = "tags" | "categories" | "tools";
 | 
			
		||||
@@ -56,7 +55,6 @@ export default defineComponent({
 | 
			
		||||
  },
 | 
			
		||||
  setup(props) {
 | 
			
		||||
    const { $auth } = useContext();
 | 
			
		||||
    const { isOwnGroup } = useLoggedInState();
 | 
			
		||||
 | 
			
		||||
    const route = useRoute();
 | 
			
		||||
    const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "")
 | 
			
		||||
@@ -74,7 +72,6 @@ export default defineComponent({
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      baseRecipeRoute,
 | 
			
		||||
      isOwnGroup,
 | 
			
		||||
      truncateText,
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user