From f405e7d02feba0f6b905cbdb973ce831dfedb337 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 4 Jan 2025 18:02:10 -0700 Subject: [PATCH] make notification errors go away automatically --- src/views/AccountViewView.vue | 12 ++++++------ src/views/ClaimAddRawView.vue | 2 +- src/views/ClaimView.vue | 16 ++++++++-------- src/views/ContactAmountsView.vue | 12 ++++++------ src/views/ContactEditView.vue | 15 +++++++-------- src/views/ContactsView.vue | 10 +++++----- src/views/DIDView.vue | 2 +- src/views/DiscoverView.vue | 12 ++++++------ src/views/GiftedDetailsView.vue | 8 ++++---- src/views/HelpNotificationsView.vue | 8 ++++---- src/views/HomeView.vue | 2 +- src/views/IdentitySwitcherView.vue | 2 +- src/views/ImportAccountView.vue | 4 ++-- src/views/OfferDetailsView.vue | 10 +++++----- src/views/ProjectViewView.vue | 2 +- src/views/ProjectsView.vue | 6 +++--- src/views/SearchAreaView.vue | 6 +++--- src/views/SeedBackupView.vue | 2 +- src/views/SharedPhotoView.vue | 2 +- src/views/StatisticsView.vue | 2 +- src/views/TestView.vue | 8 ++++---- 21 files changed, 71 insertions(+), 72 deletions(-) diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 770c3a8..45bcf64 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -936,7 +936,7 @@ export default class AccountViewView extends Vue { title: "Error Loading Profile", text: "See the Help page about errors with your personal data.", }, - -1, + 5000, ); } @@ -1339,7 +1339,7 @@ export default class AccountViewView extends Vue { title: "Export Error", text: "There was an error exporting the data.", }, - -1, + 3000, ); } @@ -1475,7 +1475,7 @@ export default class AccountViewView extends Vue { title: "Update Error", text: "Unable to update your settings. Check claim limits again.", }, - -1, + 5000, ); } } @@ -1540,7 +1540,7 @@ export default class AccountViewView extends Vue { title: "Reload", text: "Now reload the app to get a new VAPID to use with this push server.", }, - -1, + 5000, ); } @@ -1598,7 +1598,7 @@ export default class AccountViewView extends Vue { title: "Error", text: "There was a problem deleting the image. Contact support if you want it removed from the servers.", }, - -1, + 5000, ); // keep the imageUrl in localStorage so the user can try again if they want } @@ -1630,7 +1630,7 @@ export default class AccountViewView extends Vue { title: "Error", text: "There was an error deleting the image.", }, - 5000, + 3000, ); } } diff --git a/src/views/ClaimAddRawView.vue b/src/views/ClaimAddRawView.vue index 586bd82..3dbd69d 100644 --- a/src/views/ClaimAddRawView.vue +++ b/src/views/ClaimAddRawView.vue @@ -135,7 +135,7 @@ export default class ClaimAddRawView extends Vue { title: "Error", text: "There was a problem submitting the claim.", }, - -1, + 5000, ); } } diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 9e42437..a84988c 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -606,7 +606,7 @@ export default class ClaimView extends Vue { title: "Error Loading Profile", text: "See the Help page for problems with your personal data.", }, - -1, + 5000, ); } @@ -623,7 +623,7 @@ export default class ClaimView extends Vue { title: "Error", text: "No claim ID was provided.", }, - -1, + 5000, ); } @@ -685,7 +685,7 @@ export default class ClaimView extends Vue { title: "Error", text: "There was a problem retrieving that claim.", }, - -1, + 5000, ); return; } @@ -732,7 +732,7 @@ export default class ClaimView extends Vue { title: "Error", text: "Got error retrieving linked provider data.", }, - -1, + 5000, ); } } else if (this.veriClaim.claimType === "Offer") { @@ -755,7 +755,7 @@ export default class ClaimView extends Vue { title: "Error", text: "Got error retrieving linked offer data.", }, - -1, + 5000, ); } } @@ -810,7 +810,7 @@ export default class ClaimView extends Vue { title: "Error", text: "There was a problem getting that claim.", }, - -1, + 5000, ); } } catch (error: unknown) { @@ -854,7 +854,7 @@ export default class ClaimView extends Vue { title: "Error", text: "Something went wrong retrieving that claim.", }, - -1, + 5000, ); } } @@ -917,7 +917,7 @@ export default class ClaimView extends Vue { title: "Error", text: "There was a problem submitting the confirmation.", }, - -1, + 5000, ); } } diff --git a/src/views/ContactAmountsView.vue b/src/views/ContactAmountsView.vue index 60ad259..be88e30 100644 --- a/src/views/ContactAmountsView.vue +++ b/src/views/ContactAmountsView.vue @@ -165,7 +165,7 @@ export default class ContactAmountssView extends Vue { err.userMessage || "There was an error retrieving your settings or contacts or gives.", }, - -1, + 5000, ); } } @@ -196,7 +196,7 @@ export default class ContactAmountssView extends Vue { title: "Error With Server", text: "Got an error retrieving your given time from the server.", }, - -1, + 5000, ); } @@ -223,7 +223,7 @@ export default class ContactAmountssView extends Vue { title: "Error With Server", text: "Got an error retrieving your given time from the server.", }, - -1, + 5000, ); } @@ -241,7 +241,7 @@ export default class ContactAmountssView extends Vue { title: "Error With Server", text: error as string, }, - -1, + 5000, ); } } @@ -297,7 +297,7 @@ export default class ContactAmountssView extends Vue { title: "Error With Server", text: userMessage, }, - -1, + 5000, ); } } @@ -310,7 +310,7 @@ export default class ContactAmountssView extends Vue { title: "Not Allowed", text: "Only the recipient can confirm final receipt.", }, - -1, + 5000, ); } } diff --git a/src/views/ContactEditView.vue b/src/views/ContactEditView.vue index 04e63f2..04937a7 100644 --- a/src/views/ContactEditView.vue +++ b/src/views/ContactEditView.vue @@ -93,22 +93,21 @@ export default class ContactEditView extends Vue { async created() { const contactDid = (this.$route as RouteLocation).params.did; - if (!contactDid) { + const contact = await db.contacts.get(contactDid || ""); + if (contact) { + this.contact = contact; + this.contactName = contact.name || ""; + this.contactNotes = contact.notes || ""; + } else { this.$notify({ group: "alert", - type: "error", + type: "danger", title: "Contact Not Found", text: "There is no contact with that DID.", }); (this.$router as Router).push({ path: "/contacts" }); return; } - const contact = await db.contacts.get(contactDid); - if (contact) { - this.contact = contact; - this.contactName = contact.name || ""; - this.contactNotes = contact.notes || ""; - } } async saveEdit() { diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 014f32a..18827e7 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -635,7 +635,7 @@ export default class ContactsView extends Vue { (useRecipient ? "given" : "received") + " data from the server.", }, - 5000, + 3000, ); } }; @@ -693,7 +693,7 @@ export default class ContactsView extends Vue { title: "Load Error", text: "Got an error loading your gives.", }, - 5000, + 3000, ); } } @@ -969,7 +969,7 @@ export default class ContactsView extends Vue { message += " Check that the contact doesn't conflict with any you already have."; } - this.danger(message, "Contact Not Added", -1); + this.danger(message, "Contact Not Added", 5000); }); } @@ -1018,7 +1018,7 @@ export default class ContactsView extends Vue { text: (contact.name || "That unnamed person") + " has been registered.", }, - 5000, + 3000, ); } else { this.$notify( @@ -1298,7 +1298,7 @@ export default class ContactsView extends Vue { title: "Copied", text: "The link for those contacts is now in the clipboard.", }, - 5000, + 3000, ); }); } diff --git a/src/views/DIDView.vue b/src/views/DIDView.vue index fde2431..0b3c3cb 100644 --- a/src/views/DIDView.vue +++ b/src/views/DIDView.vue @@ -479,7 +479,7 @@ export default class DIDView extends Vue { title: "Error", text: e.userMessage || "There was a problem retrieving claims.", }, - -1, + 3000, ); } finally { this.isLoading = false; diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 3bff056..1ed38ee 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -337,9 +337,9 @@ export default class DiscoverView extends Vue { group: "alert", type: "danger", title: "Error", - text: `There was a problem accessing the server. Try again later.`, + text: `There was a problem accessing the server.`, }, - -1, + 3000, ); throw details; @@ -376,7 +376,7 @@ export default class DiscoverView extends Vue { title: "Error", text: e.userMessage || "There was a problem retrieving projects.", }, - -1, + 5000, ); } finally { this.isLoading = false; @@ -433,9 +433,9 @@ export default class DiscoverView extends Vue { group: "alert", type: "danger", title: "Error", - text: "There was a problem accessing the server. Try again later.", + text: "There was a problem accessing the server.", }, - -1, + 3000, ); throw await response.text(); } @@ -472,7 +472,7 @@ export default class DiscoverView extends Vue { title: "Error", text: e.userMessage || "There was a problem retrieving projects.", }, - -1, + 5000, ); } finally { this.isLoading = false; diff --git a/src/views/GiftedDetailsView.vue b/src/views/GiftedDetailsView.vue index 465c5be..72aa22b 100644 --- a/src/views/GiftedDetailsView.vue +++ b/src/views/GiftedDetailsView.vue @@ -818,7 +818,7 @@ export default class GiftedDetails extends Vue { title: "Error", text: errorMessage || "There was an error creating the give.", }, - -1, + 5000, ); } else { this.$notify( @@ -828,7 +828,7 @@ export default class GiftedDetails extends Vue { title: "Success", text: `That ${this.isTrade ? "trade" : "gift"} was recorded.`, }, - 5000, + 3000, ); localStorage.removeItem("imageUrl"); if (this.destinationPathAfter) { @@ -851,7 +851,7 @@ export default class GiftedDetails extends Vue { title: "Error", text: errorMessage, }, - -1, + 5000, ); } } @@ -912,7 +912,7 @@ export default class GiftedDetails extends Vue { title: "Data Sharing", text: libsUtil.PRIVACY_MESSAGE, }, - -1, + 7000, ); } } diff --git a/src/views/HelpNotificationsView.vue b/src/views/HelpNotificationsView.vue index e2c32c7..c4f00d6 100644 --- a/src/views/HelpNotificationsView.vue +++ b/src/views/HelpNotificationsView.vue @@ -348,7 +348,7 @@ export default class HelpNotificationsView extends Vue { // Note that this exact verbiage shows in help text. text: "You must enable notifications before testing the web push.", }, - -1, + 5000, ); return; } @@ -365,7 +365,7 @@ export default class HelpNotificationsView extends Vue { "Check your device for the test web push message" + (skipFilter ? "." : " if there are new items in your feed."), }, - -1, + 5000, ); } catch (error) { console.error("Got an error sending test notification:", error); @@ -376,7 +376,7 @@ export default class HelpNotificationsView extends Vue { title: "Error Sending Test", text: "Got an error sending the test web push notification.", }, - -1, + 5000, ); } } @@ -409,7 +409,7 @@ export default class HelpNotificationsView extends Vue { title: "Failed", text: "Got an error sending a notification.", }, - -1, + 5000, ); }); } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 1eaa011..6cd0687 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -585,7 +585,7 @@ export default class HomeView extends Vue { err.userMessage || "There was an error retrieving your settings or the latest activity.", }, - -1, + 5000, ); } } diff --git a/src/views/IdentitySwitcherView.vue b/src/views/IdentitySwitcherView.vue index 5e4630e..a781613 100644 --- a/src/views/IdentitySwitcherView.vue +++ b/src/views/IdentitySwitcherView.vue @@ -144,7 +144,7 @@ export default class IdentitySwitcherView extends Vue { title: "Error Loading Accounts", text: "Clear your cache and start over (after data backup).", }, - -1, + 5000, ); console.error("Telling user to clear cache at page create because:", err); } diff --git a/src/views/ImportAccountView.vue b/src/views/ImportAccountView.vue index c074bbf..64e188f 100644 --- a/src/views/ImportAccountView.vue +++ b/src/views/ImportAccountView.vue @@ -182,7 +182,7 @@ export default class ImportAccountView extends Vue { title: "Invalid Mnemonic", text: "Please check your mnemonic and try again.", }, - -1, + 5000, ); } else { this.$notify( @@ -192,7 +192,7 @@ export default class ImportAccountView extends Vue { title: "Error", text: "Got an error creating that identifier.", }, - -1, + 5000, ); } } diff --git a/src/views/OfferDetailsView.vue b/src/views/OfferDetailsView.vue index eb22f80..f7748f5 100644 --- a/src/views/OfferDetailsView.vue +++ b/src/views/OfferDetailsView.vue @@ -242,7 +242,7 @@ export default class OfferDetailsView extends Vue { title: "Retrieval Error", text: "The previous record isn't available for editing. If you submit, you'll create a new record.", }, - 6000, + 5000, ); } @@ -325,7 +325,7 @@ export default class OfferDetailsView extends Vue { title: "Error", text: err.message || "There was an error retrieving your settings.", }, - -1, + 5000, ); } @@ -530,7 +530,7 @@ export default class OfferDetailsView extends Vue { title: "Error", text: errorMessage || "There was an error creating the offer.", }, - -1, + 5000, ); } else { this.$notify( @@ -563,7 +563,7 @@ export default class OfferDetailsView extends Vue { title: "Error", text: errorMessage, }, - -1, + 5000, ); } } @@ -621,7 +621,7 @@ export default class OfferDetailsView extends Vue { title: "Data Sharing", text: libsUtil.PRIVACY_MESSAGE, }, - -1, + 7000, ); } } diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 45a4ab4..8f45eb6 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -576,7 +576,7 @@ export default class ProjectViewView extends Vue { title: "Error Loading Profile", text: "See the Help page to fix problems with your personal data.", }, - -1, + 5000, ); } diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index d151813..84836f5 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -475,9 +475,9 @@ export default class ProjectsView extends Vue { group: "alert", type: "danger", title: "Error", - text: "Failed to get offers from the server. Try again later.", + text: "Failed to get offers from the server.", }, - -1, + 5000, ); } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -490,7 +490,7 @@ export default class ProjectsView extends Vue { title: "Error", text: "Got an error loading offers.", }, - -1, + 5000, ); } finally { this.isLoading = false; diff --git a/src/views/SearchAreaView.vue b/src/views/SearchAreaView.vue index 0898916..11a95b3 100644 --- a/src/views/SearchAreaView.vue +++ b/src/views/SearchAreaView.vue @@ -228,7 +228,7 @@ export default class SearchAreaView extends Vue { title: "Error Updating Search Settings", text: "Try going to a different page and then coming back.", }, - -1, + 5000, ); console.error( "Telling user to retry the location search setting because:", @@ -243,7 +243,7 @@ export default class SearchAreaView extends Vue { title: "No Location Selected", text: "Select a location on the map.", }, - -1, + 5000, ); } } @@ -271,7 +271,7 @@ export default class SearchAreaView extends Vue { title: "Error Updating Search Settings", text: "Try going to a different page and then coming back.", }, - -1, + 5000, ); console.error( "Telling user to retry the location search setting because:", diff --git a/src/views/SeedBackupView.vue b/src/views/SeedBackupView.vue index a991a79..fd9d217 100644 --- a/src/views/SeedBackupView.vue +++ b/src/views/SeedBackupView.vue @@ -138,7 +138,7 @@ export default class SeedBackupView extends Vue { title: "Error Loading Profile", text: "Got an error loading your seed data.", }, - -1, + 3000, ); } } diff --git a/src/views/SharedPhotoView.vue b/src/views/SharedPhotoView.vue index f4370a8..ab9f9ab 100644 --- a/src/views/SharedPhotoView.vue +++ b/src/views/SharedPhotoView.vue @@ -120,7 +120,7 @@ export default class SharedPhotoView extends Vue { title: "Error", text: "Got an error loading this data.", }, - -1, + 3000, ); } } diff --git a/src/views/StatisticsView.vue b/src/views/StatisticsView.vue index 7adcb31..24648f0 100644 --- a/src/views/StatisticsView.vue +++ b/src/views/StatisticsView.vue @@ -91,7 +91,7 @@ export default class StatisticsView extends Vue { title: "Mounting Error", text: error.message, }, - -1, + 5000, ); } } diff --git a/src/views/TestView.vue b/src/views/TestView.vue index f22c388..4d25524 100644 --- a/src/views/TestView.vue +++ b/src/views/TestView.vue @@ -49,7 +49,7 @@ title: 'Information Alert', text: 'Just wanted you to know.', }, - -1, + 5000, ) " class="font-bold uppercase bg-slate-600 text-white px-3 py-2 rounded-md mr-2" @@ -66,7 +66,7 @@ title: 'Success Alert', text: 'Congratulations!', }, - -1, + 5000, ) " class="font-bold uppercase bg-emerald-600 text-white px-3 py-2 rounded-md mr-2" @@ -83,7 +83,7 @@ title: 'Warning Alert', text: 'You might wanna look at this.', }, - -1, + 5000, ) " class="font-bold uppercase bg-amber-600 text-white px-3 py-2 rounded-md mr-2" @@ -100,7 +100,7 @@ title: 'Danger Alert', text: 'Something terrible has happened!', }, - -1, + 5000, ) " class="font-bold uppercase bg-rose-600 text-white px-3 py-2 rounded-md mr-2"