From d7530ff56bf1c90840c1e925f960cc0a43672d98 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 27 Jan 2024 17:32:17 -0700 Subject: [PATCH] adjust more UI on the Advanced section, and make other small code & UI tweaks --- README.md | 8 ++- src/views/AccountViewView.vue | 55 +++++++++++---------- src/views/ContactAmountsView.vue | 2 +- src/views/ContactGiftingView.vue | 2 +- src/views/HelpView.vue | 10 ++-- src/views/ProjectsView.vue | 85 +++++++++++++++----------------- src/views/SeedBackupView.vue | 10 ++++ 7 files changed, 95 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index d6b78c37..ce0f4860 100644 --- a/README.md +++ b/README.md @@ -136,12 +136,18 @@ To add an icon, add to main.ts and reference with `fa` element and `icon` attrib ## Troubleshooting * A problem with `GET http://localhost:8080/web-push/vapid` means the py-push-server is not running - (and it won't work for a local app, anyway). + (and notifications won't work for a local app without special routing from the browser's web push service provider, anyway). * Red errors everywhere with a console message like this: `Error: An ID is chosen but there are no keys for it so it cannot be used to talk with the service` ... has happened on account switching when the current account was erased (or maybe replaced -- once I had a duplicate and I don't know how). +* The error `DEXIE ENCRYPT ADDON: Could not decrypt message!` or + `Encryption key has changed` means that the encryption key is wrong, + sometimes seen after clearing storage for testing; you can make it happen by clearing localStorage. + Maybe only part of the storage was cleared out. Unless you got a copy of that password, you'll + have to erase storage and reload the identifier. + ## Other diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index bb45747b..2d971e04 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -302,7 +302,7 @@ @click="handleChange" > - Contacts + Contacts Display Show amounts given
@@ -322,33 +322,17 @@
-
- Import - -
- -
-
-

Claim Server

-
- Server +
-
-

- Notification Push Server -

+

+ Notification Push Server +

+
+
+
+
+
@@ -223,8 +223,8 @@

If you don't see anything associated with a person, this is typically because they have not given you permission to see their information. Ask - them to add you to their contact list and make sure the eye next to your - name is open like this + them to add you to their contact list, and ask specifically to make sure + the eye next to your name is open like this and not closed like this .

diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index e73c79a0..23e5d5b4 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -103,9 +103,46 @@ export default class ProjectsView extends Vue { isLoading = false; numAccounts = 0; - async beforeCreate() { - await accountsDB.open(); - this.numAccounts = await accountsDB.accounts.count(); + /** + * 'created' hook runs when the Vue instance is first created + **/ + async created() { + try { + await db.open(); + const settings = await db.settings.get(MASTER_SETTINGS_KEY); + const activeDid = settings?.activeDid || ""; + this.apiServer = settings?.apiServer || ""; + + await accountsDB.open(); + this.numAccounts = await accountsDB.accounts.count(); + if (this.numAccounts === 0) { + console.error("No accounts found."); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You need an identifier to load your projects.", + }, + -1, + ); + } else { + const identity = await this.getIdentity(activeDid); + this.current = identity; + this.loadProjects(identity); + } + } catch (err) { + console.log("Error initializing:", err); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Something went wrong loading your projects.", + }, + -1, + ); + } } /** @@ -186,7 +223,7 @@ export default class ProjectsView extends Vue { * Load projects initially * @param identity of the user **/ - async LoadProjects(identity: IIdentifier) { + async loadProjects(identity: IIdentifier) { const url = `${this.apiServer}/api/v2/report/plansByIssuer`; const token: string = await accessToken(identity); await this.dataLoader(url, token); @@ -208,46 +245,6 @@ export default class ProjectsView extends Vue { return identity; } - /** - * 'created' hook runs when the Vue instance is first created - **/ - async created() { - try { - await db.open(); - const settings = await db.settings.get(MASTER_SETTINGS_KEY); - const activeDid = settings?.activeDid || ""; - this.apiServer = settings?.apiServer || ""; - - if (this.numAccounts === 0) { - console.error("No accounts found."); - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: "You need an identifier to load your projects.", - }, - -1, - ); - } else { - const identity = await this.getIdentity(activeDid); - this.current = identity; - this.LoadProjects(identity); - } - } catch (err) { - console.log("Error initializing:", err); - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: "Something went wrong loading your projects.", - }, - -1, - ); - } - } - /** * Handling clicking on the new project button **/ diff --git a/src/views/SeedBackupView.vue b/src/views/SeedBackupView.vue index b5fbac94..5da26ea4 100644 --- a/src/views/SeedBackupView.vue +++ b/src/views/SeedBackupView.vue @@ -2,6 +2,16 @@
+ +
+

+ +

+
+

Seed Backup