fix problem where canceling an edit deletes an image
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user