mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 21:15:22 +02:00
fix: JSON Mode Resets Page State (#4519)
This commit is contained in:
parent
381a698220
commit
e3c6d4c66c
2 changed files with 12 additions and 7 deletions
|
@ -96,7 +96,13 @@ import RecipePageTitleContent from "./RecipePageParts/RecipePageTitleContent.vue
|
||||||
import RecipePageComments from "./RecipePageParts/RecipePageComments.vue";
|
import RecipePageComments from "./RecipePageParts/RecipePageComments.vue";
|
||||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||||
import RecipePrintContainer from "~/components/Domain/Recipe/RecipePrintContainer.vue";
|
import RecipePrintContainer from "~/components/Domain/Recipe/RecipePrintContainer.vue";
|
||||||
import { EditorMode, PageMode, usePageState, usePageUser } from "~/composables/recipe-page/shared-state";
|
import {
|
||||||
|
clearPageState,
|
||||||
|
EditorMode,
|
||||||
|
PageMode,
|
||||||
|
usePageState,
|
||||||
|
usePageUser,
|
||||||
|
} from "~/composables/recipe-page/shared-state";
|
||||||
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||||
import { Recipe } from "~/lib/api/types/recipe";
|
import { Recipe } from "~/lib/api/types/recipe";
|
||||||
import { useRouteQuery } from "~/composables/use-router";
|
import { useRouteQuery } from "~/composables/use-router";
|
||||||
|
@ -170,6 +176,9 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deactivateNavigationWarning();
|
deactivateNavigationWarning();
|
||||||
|
|
||||||
|
clearPageState(props.recipe.slug || "");
|
||||||
|
console.debug("reset RecipePage state during unmount");
|
||||||
});
|
});
|
||||||
|
|
||||||
/** =============================================================
|
/** =============================================================
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, onUnmounted } from "@nuxtjs/composition-api";
|
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||||
import { clearPageState, usePageState, usePageUser } from "~/composables/recipe-page/shared-state";
|
import { usePageState, usePageUser } from "~/composables/recipe-page/shared-state";
|
||||||
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||||
import { Recipe } from "~/lib/api/types/recipe";
|
import { Recipe } from "~/lib/api/types/recipe";
|
||||||
import { useUserApi } from "~/composables/api";
|
import { useUserApi } from "~/composables/api";
|
||||||
|
@ -75,10 +75,6 @@ export default defineComponent({
|
||||||
return households.value.find((h) => h.id === owner.householdId);
|
return households.value.find((h) => h.id === owner.householdId);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
clearPageState(props.recipe.slug);
|
|
||||||
console.debug("reset RecipePage state during unmount");
|
|
||||||
});
|
|
||||||
async function uploadImage(fileObject: File) {
|
async function uploadImage(fileObject: File) {
|
||||||
if (!props.recipe || !props.recipe.slug) {
|
if (!props.recipe || !props.recipe.slug) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue