mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-27 09:09:43 +02:00
bug/bug-fixes (#424)
* fix image write/caching * Caddyfile Caching header * more aggressive caching Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
eb3d56936e
commit
503fe5cb2e
11 changed files with 44 additions and 34 deletions
|
@ -155,9 +155,9 @@ export default {
|
|||
this.recipeDetails = await api.recipes.requestDetails(this.currentRecipe);
|
||||
this.skeleton = false;
|
||||
},
|
||||
getImage(image) {
|
||||
if (image) {
|
||||
return api.recipes.recipeImage(image) + "?&rnd=" + this.imageKey;
|
||||
getImage(slug) {
|
||||
if (slug) {
|
||||
return api.recipes.recipeImage(slug, this.imageKey, this.recipeDetails.image);
|
||||
}
|
||||
},
|
||||
async deleteRecipe() {
|
||||
|
@ -175,7 +175,9 @@ export default {
|
|||
},
|
||||
async saveImage(overrideSuccessMsg = false) {
|
||||
if (this.fileObject) {
|
||||
if (api.recipes.updateImage(this.recipeDetails.slug, this.fileObject, overrideSuccessMsg)) {
|
||||
const newVersion = await api.recipes.updateImage(this.recipeDetails.slug, this.fileObject, overrideSuccessMsg);
|
||||
if (newVersion) {
|
||||
this.recipeDetails.image = newVersion.data.version;
|
||||
this.imageKey += 1;
|
||||
}
|
||||
}
|
||||
|
@ -192,6 +194,7 @@ export default {
|
|||
if (slug != this.recipeDetails.slug) {
|
||||
this.$router.push(`/recipe/${slug}`);
|
||||
}
|
||||
window.URL.revokeObjectURL(this.getImage(this.recipeDetails.slug));
|
||||
}
|
||||
},
|
||||
printPage() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue