From a8d362c14d2801ca662cf249220e0d2b9c3ce845 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Mon, 4 Dec 2023 13:36:51 -0700 Subject: [PATCH] don't show note about registering if this user isn't registered --- project.task.yaml | 1 + src/views/ContactsView.vue | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index f22b95d5..c5a923ec 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -33,6 +33,7 @@ tasks: - make identicons for contacts into more-memorable faces (and maybe change project identicons, too) - allow download of each VC (to show that they can actually own their data) - allow some gives even if they aren't registered +- switch some checks for activeDid to check for isRegistered - contacts v+ : - 01 Import all the non-sensitive data (ie. contacts & settings). diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 0e75ad05..216a9074 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -305,6 +305,7 @@ export default class ContactsView extends Vue { givenToMeUnconfirmed: Record = {}; hourDescriptionInput = ""; hourInput = "0"; + isRegistered = false; showGiveNumbers = false; showGiveTotals = true; showGiveConfirmed = true; @@ -314,6 +315,7 @@ export default class ContactsView extends Vue { const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings; this.activeDid = settings?.activeDid || ""; this.apiServer = settings?.apiServer || ""; + this.isRegistered = !!settings?.isRegistered; this.showGiveNumbers = !!settings?.showContactGivesInline; if (this.showGiveNumbers) { @@ -560,19 +562,21 @@ export default class ContactsView extends Vue { }, 5000, ); - // putting this last so that it shows on the top - this.$notify( - { - group: "alert", - type: "info", - title: "New User?", - text: - "If " + - newContact.name + - " is a new user, be sure to register them.", - }, - -1, - ); + if (this.isRegistered) { + // putting this last so that it shows on the top + this.$notify( + { + group: "alert", + type: "info", + title: "New User?", + text: + "If " + + newContact.name + + " is a new user, be sure to register them.", + }, + -1, + ); + } }) .catch((err) => { console.error("Error when adding contact to storage:", err);