fix problem where canceling an edit deletes an image

This commit is contained in:
2026-03-22 20:06:58 -06:00
parent 05d346edce
commit ad8df3eb93

View File

@@ -517,7 +517,10 @@ export default class GiftedDetails extends Vue {
}
cancel() {
this.deleteImage(); // not awaiting, so they'll go back immediately
// Only delete if the image was freshly uploaded, not loaded from an existing claim
if (this.imageUrl !== this.prevCredToEdit?.claim?.image) {
this.deleteImage(); // not awaiting, so they'll go back immediately
}
if (this.destinationPathAfter) {
(this.$router as Router).push({ path: this.destinationPathAfter });
} else {
@@ -526,7 +529,10 @@ export default class GiftedDetails extends Vue {
}
cancelBack() {
this.deleteImage(); // not awaiting, so they'll go back immediately
// Only delete if the image was freshly uploaded, not loaded from an existing claim
if (this.imageUrl !== this.prevCredToEdit?.claim?.image) {
this.deleteImage(); // not awaiting, so they'll go back immediately
}
(this.$router as Router).back();
}