From c226e71c17c586ce114b00d37cb84181cd4817c0 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Mon, 11 Dec 2023 03:36:45 -0600 Subject: [PATCH] overwrite history to avoid duplicating recipe imports (#2820) Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com> --- frontend/pages/g/_groupSlug/r/create/url.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/pages/g/_groupSlug/r/create/url.vue b/frontend/pages/g/_groupSlug/r/create/url.vue index e04265600cd3..e98d335e06c8 100644 --- a/frontend/pages/g/_groupSlug/r/create/url.vue +++ b/frontend/pages/g/_groupSlug/r/create/url.vue @@ -103,7 +103,11 @@ export default defineComponent({ if (refreshTags) { tags.actions.refresh(); } - router.push(`/g/${groupSlug.value}/r/${response.data}?edit=${edit.toString()}`); + + // we clear the query params first so if the user hits back, they don't re-import the recipe + router.replace({ query: {} }).then( + () => router.push(`/g/${groupSlug.value}/r/${response.data}?edit=${edit.toString()}`) + ); } const recipeUrl = computed({