From c602c5ce50c4d698540fbf66a0bc60ee6467239a Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 10 Mar 2024 14:53:41 -0600 Subject: [PATCH] add some other image deletions in other cases --- project.task.yaml | 4 ++++ src/views/GiftedDetails.vue | 18 +++++++----------- src/views/GiftedPhoto.vue | 11 ++--------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index 0d9f47d3..4d3115b8 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -18,6 +18,10 @@ tasks : - upload to a public readable place at correct hosting location - remove previous image when editing - on gift details, if project then show, otherwise mark "gift for you" + - ping endpoint + - limits endpoint + +- 08 image on profile - ask to detect location & record it in settings - if personal location is set, show potential local affiliations diff --git a/src/views/GiftedDetails.vue b/src/views/GiftedDetails.vue index 463a3f93..0ece39ef 100644 --- a/src/views/GiftedDetails.vue +++ b/src/views/GiftedDetails.vue @@ -8,7 +8,7 @@

@@ -184,6 +184,7 @@ export default class GiftedDetails extends Vue { } cancel() { + this.deleteImage(); // not awaiting, so they'll go back immediately this.$router.back(); } @@ -212,15 +213,8 @@ export default class GiftedDetails extends Vue { }, ); if (response.status === 204) { - this.$notify( - { - group: "alert", - type: "success", - title: "Deleted", - text: "That image record was deleted.", - }, - 5000, - ); + // don't bother with a notification + // (either they'll simply continue or they're canceling and going back) } else { console.error("Error deleting image:", response); this.$notify( @@ -232,6 +226,7 @@ export default class GiftedDetails extends Vue { }, 5000, ); + // keep the imageUrl in localStorage so the user can try again if they want return; } localStorage.removeItem("imageUrl"); @@ -328,8 +323,9 @@ export default class GiftedDetails extends Vue { title: "Success", text: `That ${this.isTrade ? "trade" : "gift"} was recorded.`, }, - 7000, + 5000, ); + localStorage.removeItem("imageUrl"); this.$router.back(); } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/views/GiftedPhoto.vue b/src/views/GiftedPhoto.vue index 691781e1..0b4529f7 100644 --- a/src/views/GiftedPhoto.vue +++ b/src/views/GiftedPhoto.vue @@ -154,15 +154,8 @@ export default class GiftedPhoto extends Vue { ); this.uploading = false; - this.$notify( - { - group: "alert", - type: "success", - title: "Stored", - text: "Your picture has been stored.", - }, - 3000, - ); + // we won't give a notification here because the user will be taken back to finish + localStorage.setItem("imageUrl", response.data.url as string); this.$router.back(); } catch (error) {