1
0
Fork 0
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:
Hayden 2021-05-23 15:05:39 -08:00 committed by GitHub
parent eb3d56936e
commit 503fe5cb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 44 additions and 34 deletions

View file

@ -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() {