1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 23:59:45 +02:00

Fix/multiple bug reports (#1002)

* fix type issues for #999

* fix regression #995

* remove error from frontend and log error #996

* cleanup darkmode on login page

* keep primary color bg
This commit is contained in:
Hayden 2022-02-23 15:04:45 -09:00 committed by GitHub
parent 6ccffce320
commit ccfaa02b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 102 additions and 57 deletions

View file

@ -504,10 +504,12 @@ export default defineComponent({
async beforeRouteLeave(_to, _from, next) {
const isSame = JSON.stringify(this.recipe) === JSON.stringify(this.originalRecipe);
console.log({ working: this.recipe, saved: this.originalRecipe });
if (this.form && !isSame && this.recipe?.slug !== undefined) {
if (window.confirm("You have unsaved changes. Do you want to save before leaving?")) {
if (
window.confirm(
"You have unsaved changes. Do you want to save before leaving?\n\nOkay to save, Cancel to discard changes."
)
) {
await this.api.recipes.updateOne(this.recipe.slug, this.recipe);
}
}
@ -558,7 +560,6 @@ export default defineComponent({
invoke(async () => {
await until(recipe).not.toBeNull();
originalRecipe.value = deepCopy(recipe.value);
});
@ -746,6 +747,7 @@ export default defineComponent({
useMeta(metaData);
return {
originalRecipe,
createApiExtra,
apiNewKey,
enableLandscape,