diff --git a/src/App.vue b/src/App.vue index 901477f..df60ac7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,10 @@
- +
@@ -63,7 +66,10 @@
- +
@@ -86,7 +92,10 @@
- +
@@ -109,7 +118,10 @@
- +
diff --git a/src/components/FeedFilters.vue b/src/components/FeedFilters.vue index 535aaff..7762edf 100644 --- a/src/components/FeedFilters.vue +++ b/src/components/FeedFilters.vue @@ -98,7 +98,7 @@ import { LRectangle, LTileLayer, } from "@vue-leaflet/vue-leaflet"; - +import { Router } from "vue-router"; import { MASTER_SETTINGS_KEY } from "../db/tables/settings"; import { db, retrieveSettingsForActiveAccount } from "../db/index"; @@ -111,6 +111,7 @@ import { db, retrieveSettingsForActiveAccount } from "../db/index"; }, }) export default class FeedFilters extends Vue { + $router!: Router; onCloseIfChanged = () => {}; hasSearchBox = false; hasVisibleDid = false; diff --git a/src/components/GiftedPrompts.vue b/src/components/GiftedPrompts.vue index 639bd96..a8d1a06 100644 --- a/src/components/GiftedPrompts.vue +++ b/src/components/GiftedPrompts.vue @@ -82,6 +82,7 @@ import { GiverReceiverInputInfo } from "../libs/util"; @Component export default class GivenPrompts extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $router!: Router; CATEGORY_CONTACTS = 1; CATEGORY_IDEAS = 0; @@ -145,7 +146,7 @@ export default class GivenPrompts extends Vue { // proceed with logic but don't change values (just in case some actions are added later) this.visible = false; if (this.currentCategory === this.CATEGORY_IDEAS) { - (this.$router as Router).push({ + this.$router.push({ name: "contact-gift", query: { prompt: this.IDEAS[this.currentIdeaIndex], diff --git a/src/components/HiddenDidDialog.vue b/src/components/HiddenDidDialog.vue index 061a466..847e1bb 100644 --- a/src/components/HiddenDidDialog.vue +++ b/src/components/HiddenDidDialog.vue @@ -53,7 +53,10 @@ target="_blank" class="text-blue-500" > - + diff --git a/src/components/ImageMethodDialog.vue b/src/components/ImageMethodDialog.vue index 35b5364..d4e1145 100644 --- a/src/components/ImageMethodDialog.vue +++ b/src/components/ImageMethodDialog.vue @@ -41,7 +41,11 @@ @click="acceptUrl" /> - +
diff --git a/src/components/OnboardingDialog.vue b/src/components/OnboardingDialog.vue index c8a6f15..83e6f77 100644 --- a/src/components/OnboardingDialog.vue +++ b/src/components/OnboardingDialog.vue @@ -219,6 +219,7 @@ import { OnboardPage } from "../libs/util"; }) export default class OnboardingDialog extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $router!: Router; activeDid = ""; firstContactName = null; @@ -254,7 +255,7 @@ export default class OnboardingDialog extends Vue { finishedOnboarding: true, }); if (goHome) { - (this.$router as Router).push({ name: "home" }); + this.$router.push({ name: "home" }); } } } diff --git a/src/components/PushNotificationPermission.vue b/src/components/PushNotificationPermission.vue index a49ca91..90e8b9b 100644 --- a/src/components/PushNotificationPermission.vue +++ b/src/components/PushNotificationPermission.vue @@ -69,7 +69,9 @@ class="rounded-r border border-slate-400 bg-slate-200 text-center text-blue-500 mt-2 px-2 py-2 w-20" @click="hourAm = !hourAm" > - AM + + AM + PM diff --git a/src/interfaces/claims.ts b/src/interfaces/claims.ts index 2b14c73..b5ad266 100644 --- a/src/interfaces/claims.ts +++ b/src/interfaces/claims.ts @@ -30,9 +30,9 @@ export interface OfferVerifiableCredential extends GenericVerifiableCredential { includesObject?: { amountOfThisGood: number; unitCode: string }; itemOffered?: { description?: string; - isPartOf?: { - identifier?: string; - lastClaimId?: string; + isPartOf?: { + identifier?: string; + lastClaimId?: string; "@type"?: string; name?: string; }; diff --git a/src/interfaces/records.ts b/src/interfaces/records.ts index 0e253be..3df8469 100644 --- a/src/interfaces/records.ts +++ b/src/interfaces/records.ts @@ -2,6 +2,7 @@ import { GiveVerifiableCredential, OfferVerifiableCredential } from "./claims"; // a summary record; the VC is found the fullClaim field export interface GiveSummaryRecord { + [x: string]: PropertyKey | undefined | GiveVerifiableCredential; type?: string; agentDid: string; amount: number; diff --git a/src/lib/capacitor/app.ts b/src/lib/capacitor/app.ts index 72f7098..bc5c1e5 100644 --- a/src/lib/capacitor/app.ts +++ b/src/lib/capacitor/app.ts @@ -1,9 +1,59 @@ // Import from node_modules using relative path -import { App as CapacitorApp } from '../../../node_modules/@capacitor/app'; - -// Re-export the App interface with our own wrapper -export const App = { - addListener: (eventName: string, listenerFunc: (data: any) => void) => { - return CapacitorApp.addListener(eventName, listenerFunc); - } -}; \ No newline at end of file + +import { + App as CapacitorApp, + AppLaunchUrl, + BackButtonListener, +} from "@capacitor/app"; +import type { PluginListenerHandle } from "@capacitor/core"; + +/** + * Interface defining the app event listener functionality + * Supports 'backButton' and 'appUrlOpen' events from Capacitor + */ +interface AppInterface { + /** + * Add listener for back button events + * @param eventName - Must be 'backButton' + * @param listenerFunc - Callback function for back button events + * @returns Promise that resolves with a removable listener handle + */ + addListener( + eventName: "backButton", + listenerFunc: BackButtonListener, + ): Promise & PluginListenerHandle; + + /** + * Add listener for app URL open events + * @param eventName - Must be 'appUrlOpen' + * @param listenerFunc - Callback function for URL open events + * @returns Promise that resolves with a removable listener handle + */ + addListener( + eventName: "appUrlOpen", + listenerFunc: (data: AppLaunchUrl) => void, + ): Promise & PluginListenerHandle; +} + +/** + * App wrapper for Capacitor functionality + * Provides type-safe event listeners for back button and URL open events + */ +export const App: AppInterface = { + addListener( + eventName: "backButton" | "appUrlOpen", + listenerFunc: BackButtonListener | ((data: AppLaunchUrl) => void), + ): Promise & PluginListenerHandle { + if (eventName === "backButton") { + return CapacitorApp.addListener( + eventName, + listenerFunc as BackButtonListener, + ) as Promise & PluginListenerHandle; + } else { + return CapacitorApp.addListener( + eventName, + listenerFunc as (data: AppLaunchUrl) => void, + ) as Promise & PluginListenerHandle; + } + }, +}; diff --git a/src/main.capacitor.ts b/src/main.capacitor.ts index 4f818b1..c7c0ab3 100644 --- a/src/main.capacitor.ts +++ b/src/main.capacitor.ts @@ -97,14 +97,14 @@ const handleDeepLink = async (data: { url: string }) => { const paramRoutes = { "claim-add-raw": /^claim-add-raw\/(.+)$/, "claim-cert": /^claim-cert\/(.+)$/, - "claim": /^claim\/(.+)$/, + claim: /^claim\/(.+)$/, "confirm-gift": /^confirm-gift\/(.+)$/, "contact-edit": /^contact-edit\/(.+)$/, "contact-import": /^contact-import\/(.+)$/, - "did": /^did\/(.+)$/, + did: /^did\/(.+)$/, "invite-one-accept": /^invite-one-accept\/(.+)$/, "offer-details": /^offer-details\/(.+)$/, - "project": /^project\/(.+)$/, + project: /^project\/(.+)$/, "user-profile": /^user-profile\/(.+)$/, }; diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 9daacf3..3fae7c9 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -44,7 +44,10 @@ {{ givenName }} - +
@@ -268,8 +271,11 @@ class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8" >
- Loading - profile... + + Loading profile...
Public Profile @@ -363,7 +369,8 @@
Usage Limits
- Checking… + Checking… +
{{ limitsMessage }} @@ -494,7 +501,10 @@ " class="ml-2" > - + Copied
@@ -510,7 +520,10 @@ " class="ml-2" > - + Copied
@@ -530,7 +543,10 @@ " class="ml-2" > - + Copied
@@ -631,7 +647,11 @@ class="w-full px-4 rounded bg-yellow-500 border border-slate-400" @click="onClickSaveApiServer()" > - +
@@ -45,7 +50,10 @@ class="text-blue-500 mt-2" title="Printable Certificate" > - +
@@ -66,7 +74,7 @@ {{ (veriClaim.claim?.itemOffered as any)?.description || (veriClaim.claim as any)?.description || - '' + "" }}
@@ -78,9 +86,15 @@ Recorded {{ veriClaim.issuedAt?.replace(/T/, " ").replace(/Z/, " UTC") }}
-
+
- +
@@ -197,7 +211,10 @@ class="col-span-1 block w-fit text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md" > Affirm Delivery - +
@@ -217,7 +234,10 @@ @click="confirmConfirmClaim()" > Confirm - +

Confirmations

@@ -277,7 +297,10 @@ target="_blank" class="text-blue-500" > - + @@ -315,7 +338,10 @@ target="_blank" class="text-blue-500" > - + @@ -428,7 +454,10 @@ target="_blank" class="text-blue-500" > - + Confirm - + @@ -67,7 +73,10 @@
gave
- + {{ displayAmount(giveDetails.unit, giveDetails.amount) }}
@@ -99,7 +108,10 @@ target="_blank" > This fulfills a bigger plan - +
@@ -125,7 +137,10 @@ giveDetails?.fulfillsType || "", ) }} - + @@ -185,7 +200,10 @@ ) " > - +
@@ -228,7 +246,10 @@ ) " > - + @@ -342,12 +363,18 @@ copyToClipboard('The DID of ' + visDid, visDid) " > - + , found at - + {{ displayAmount(record.unit, record.amount) }} - + @@ -215,7 +218,10 @@ }" title="See more about this person" > - + {{ @@ -399,6 +405,8 @@ import { generateSaveAndActivateIdentity } from "../libs/util"; }) export default class ContactsView extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $route!: RouteLocationNormalizedLoaded; + $router!: Router; activeDid = ""; apiServer = ""; @@ -465,8 +473,7 @@ export default class ContactsView extends Vue { // // For external links, use /contact-import/:jwt with a JWT that has an array of contacts // because that will do better error checking for things like missing data on iOS platforms. - const importedContactJwt = (this.$route as RouteLocationNormalizedLoaded) - .query["contactJwt"] as string; + const importedContactJwt = this.$route.query["contactJwt"] as string; if (importedContactJwt) { // really should fully verify contents const { payload } = decodeEndorserJwt(importedContactJwt); @@ -481,14 +488,13 @@ export default class ContactsView extends Vue { } as Contact; await this.addContact(newContact); // if we're here, they haven't redirected anywhere, so we'll redirect here without a query parameter - (this.$router as Router).push({ path: "/contacts" }); + this.$router.push({ path: "/contacts" }); } } private async processInviteJwt() { // handle an invite JWT sent via URL - const importedInviteJwt = (this.$route as RouteLocationNormalizedLoaded) - .query["inviteJwt"] as string; + const importedInviteJwt = this.$route.query["inviteJwt"] as string; if (importedInviteJwt === "") { // this happens when a platform (eg iOS) doesn't include anything after the "=" in a shared link. this.$notify( @@ -590,7 +596,7 @@ export default class ContactsView extends Vue { ); } // if we're here, they haven't redirected anywhere, so we'll redirect here without a query parameter - (this.$router as Router).push({ path: "/contacts" }); + this.$router.push({ path: "/contacts" }); } } @@ -630,7 +636,7 @@ export default class ContactsView extends Vue { title: "They're Added To Your List", text: "Would you like to go to the main page now?", onYes: async () => { - (this.$router as Router).push({ name: "home" }); + this.$router.push({ name: "home" }); }, }, -1, @@ -767,9 +773,7 @@ export default class ContactsView extends Vue { if (contactInput.includes(CONTACT_IMPORT_CONFIRM_URL_PATH_TIME_SAFARI)) { const jwt = getContactJwtFromJwtUrl(contactInput); - (this.$router as Router).push({ - path: "/contact-import/" + jwt, - }); + this.$router.push({ path: "/contact-import/" + jwt }); return; } @@ -877,7 +881,7 @@ export default class ContactsView extends Vue { ); try { const contacts = JSON.parse(jsonContactInput); - (this.$router as Router).push({ + this.$router.push({ name: "contact-import", query: { contacts: JSON.stringify(contacts) }, }); @@ -1203,7 +1207,7 @@ export default class ContactsView extends Vue { this.showGiftedDialog(giverDid, recipientDid); }, onYes: async () => { - (this.$router as Router).push({ + this.$router.push({ name: "contact-amounts", query: { contactDid: giverDid }, }); @@ -1403,10 +1407,10 @@ export default class ContactsView extends Vue { if (hostResponse.data.data) { // They're the host, take them to setup - (this.$router as Router).push({ name: "onboard-meeting-setup" }); + this.$router.push({ name: "onboard-meeting-setup" }); } else { // They're not the host, take them to list - (this.$router as Router).push({ name: "onboard-meeting-list" }); + this.$router.push({ name: "onboard-meeting-list" }); } } else { // They're not in a meeting, show the dialog @@ -1417,11 +1421,11 @@ export default class ContactsView extends Vue { title: "Onboarding Meeting", text: "Would you like to start a new meeting?", onYes: async () => { - (this.$router as Router).push({ name: "onboard-meeting-setup" }); + this.$router.push({ name: "onboard-meeting-setup" }); }, yesText: "Start New Meeting", onNo: async () => { - (this.$router as Router).push({ name: "onboard-meeting-list" }); + this.$router.push({ name: "onboard-meeting-list" }); }, noText: "Join Existing Meeting", }, diff --git a/src/views/DIDView.vue b/src/views/DIDView.vue index 4daf52d..1928e7c 100644 --- a/src/views/DIDView.vue +++ b/src/views/DIDView.vue @@ -37,7 +37,11 @@ class="ml-2 mr-2 mt-4" > Details - + @@ -106,7 +110,11 @@ icon="person-circle-check" class="fa-fw" /> - + @@ -194,7 +202,10 @@ - + @@ -216,7 +227,7 @@ import { AxiosError } from "axios"; import * as yaml from "js-yaml"; import { Component, Vue } from "vue-facing-decorator"; -import { Router } from "vue-router"; +import { RouteLocationNormalizedLoaded, Router } from "vue-router"; import QuickNav from "../components/QuickNav.vue"; import InfiniteScroll from "../components/InfiniteScroll.vue"; @@ -226,14 +237,16 @@ import { db, retrieveSettingsForActiveAccount } from "../db/index"; import { Contact } from "../db/tables/contacts"; import { BoundingBox } from "../db/tables/settings"; import { - capitalizeAndInsertSpacesBeforeCaps, - didInfoForContact, - displayAmount, - getHeaders, GenericCredWrapper, GenericVerifiableCredential, GiveVerifiableCredential, OfferVerifiableCredential, +} from "../interfaces"; +import { + capitalizeAndInsertSpacesBeforeCaps, + didInfoForContact, + displayAmount, + getHeaders, register, setVisibilityUtil, } from "../libs/endorserServer"; @@ -250,6 +263,8 @@ import EntityIcon from "../components/EntityIcon.vue"; }) export default class DIDView extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $route!: RouteLocationNormalizedLoaded; + $router!: Router; libsUtil = libsUtil; yaml = yaml; @@ -352,7 +367,7 @@ export default class DIDView extends Vue { }, 3000, ); - (this.$router as Router).push({ name: "contacts" }); + this.$router.push({ name: "contacts" }); } // confirm to register a new contact @@ -505,7 +520,7 @@ export default class DIDView extends Vue { const route = { path: "/claim/" + encodeURIComponent(jwtId), }; - (this.$router as Router).push(route); + this.$router.push(route); } public claimAmount(claim: GenericVerifiableCredential) { diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index dd72de9..4a291c2 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -225,7 +225,10 @@

{{ project.name }}

- + {{ didInfo( project.issuerDid, @@ -253,7 +256,10 @@ >
- + {{ didInfo( profile.issuerDid, @@ -273,7 +279,10 @@ v-if="isAnywhereActive && profile.locLat && profile.locLon" class="mt-1 text-xs text-slate-500" > - + {{ (profile.locLat > 0 ? "North" : "South") + " in " + @@ -313,11 +322,11 @@ import { } from "../db/index"; import { Contact } from "../db/tables/contacts"; import { BoundingBox } from "../db/tables/settings"; +import { PlanData } from "../interfaces"; import { didInfo, errorStringForLog, getHeaders, - PlanData, } from "../libs/endorserServer"; import { OnboardPage, retrieveAccountDids } from "../libs/util"; diff --git a/src/views/GiftedDetailsView.vue b/src/views/GiftedDetailsView.vue index 08f1ba6..aaacc97 100644 --- a/src/views/GiftedDetailsView.vue +++ b/src/views/GiftedDetailsView.vue @@ -325,7 +325,7 @@ export default class GiftedDetails extends Vue { try { this.prevCredToEdit = (this.$route.query["prevCredToEdit"] as string) ? (JSON.parse( - (this.$route.query["prevCredToEdit"] as string), + this.$route.query["prevCredToEdit"] as string, ) as GenericCredWrapper) : undefined; } catch (error) { @@ -349,15 +349,16 @@ export default class GiftedDetails extends Vue { (this.$route.query["description"] as string) || this.prevCredToEdit?.claim?.description || this.description; - this.destinationPathAfter = (this.$route.query["destinationPathAfter"] as string) || ""; + this.destinationPathAfter = + (this.$route.query["destinationPathAfter"] as string) || ""; this.giverDid = ((this.$route.query["giverDid"] as string) || - (this.prevCredToEdit?.claim?.agent as any)?.identifier || + (this.prevCredToEdit?.claim?.agent as unknown as { identifier: string }) + ?.identifier || this.giverDid) as string; - this.giverName = - ((this.$route.query["giverName"] as string) || ""); + this.giverName = (this.$route.query["giverName"] as string) || ""; this.hideBackButton = (this.$route.query["hideBackButton"] as string) === "true"; - this.message = ((this.$route.query["message"] as string) || ""); + this.message = (this.$route.query["message"] as string) || ""; // find any offer ID const fulfills = this.prevCredToEdit?.claim?.fulfills; @@ -391,38 +392,38 @@ export default class GiftedDetails extends Vue { const providerProject = providerArray.find( (rec) => rec["@type"] === "PlanAction", ); - this.providerProjectId = ((this.$route.query["providerProjectId"] as string) || + this.providerProjectId = ((this.$route.query[ + "providerProjectId" + ] as string) || providerProject?.identifier || this.providerProjectId) as string; this.recipientDid = ((this.$route.query["recipientDid"] as string) || this.prevCredToEdit?.claim?.recipient?.identifier) as string; - this.recipientName = - ((this.$route.query["recipientName"] as string) || ""); + this.recipientName = (this.$route.query["recipientName"] as string) || ""; this.unitCode = ((this.$route.query["unitCode"] as string) || this.prevCredToEdit?.claim?.object?.unitCode || this.unitCode) as string; - this.imageUrl = - ((this.$route.query["imageUrl"] as string) || + this.imageUrl = ((this.$route.query["imageUrl"] as string) || this.prevCredToEdit?.claim?.image || localStorage.getItem("imageUrl") || this.imageUrl) as string; // this is an endpoint for sharing project info to highlight something given // https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target - if ((this.$route.query["shareTitle"] as string)) { + if (this.$route.query["shareTitle"] as string) { this.description = ((this.$route.query["shareTitle"] as string) || "") + (this.description ? "\n" + this.description : ""); } - if ((this.$route.query["shareText"] as string)) { + if (this.$route.query["shareText"] as string) { this.description = (this.description ? this.description + "\n" : "") + ((this.$route.query["shareText"] as string) || ""); } - if ((this.$route.query["shareUrl"] as string)) { - this.imageUrl = (this.$route.query["shareUrl"] as string); + if (this.$route.query["shareUrl"] as string) { + this.imageUrl = this.$route.query["shareUrl"] as string; } const settings = await retrieveSettingsForActiveAccount(); diff --git a/src/views/HelpNotificationsView.vue b/src/views/HelpNotificationsView.vue index 2538233..c027986 100644 --- a/src/views/HelpNotificationsView.vue +++ b/src/views/HelpNotificationsView.vue @@ -313,11 +313,12 @@ import { DIRECT_PUSH_TITLE, sendTestThroughPushServer } from "../libs/util"; import PushNotificationPermission from "../components/PushNotificationPermission.vue"; import { db } from "../db/index"; import { MASTER_SETTINGS_KEY } from "../db/tables/settings"; +import { Router } from "vue-router"; @Component({ components: { PushNotificationPermission, QuickNav } }) export default class HelpNotificationsView extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; - + $router!: Router; subscriptionJSON?: PushSubscriptionJSON; async mounted() { diff --git a/src/views/HelpOnboardingView.vue b/src/views/HelpOnboardingView.vue index f32d769..989effc 100644 --- a/src/views/HelpOnboardingView.vue +++ b/src/views/HelpOnboardingView.vue @@ -24,8 +24,9 @@

Then watch that page to see when they accept their invite.

- (That page is also reachable from the Contacts page - though the invitation icon.) + (That page is also reachable from the Contacts + page though the invitation + icon.)

Next Steps

@@ -35,12 +36,13 @@

Without a backup, you can lose data.

- Exporting backups (from the Account screen) - is important for the case where they lose their device. This is - especially true for the Identifier Seed: that is theirs and and theirs - alone, and currently nobody else can recover it if they lose it. The - good thing is that anyone can create a new account and simply inform - their network of their new ID. + Exporting backups (from the Account + screen) is important for the case + where they lose their device. This is especially true for the + Identifier Seed: that is theirs and and theirs alone, and currently + nobody else can recover it if they lose it. The good thing is that + anyone can create a new account and simply inform their network of + their new ID.

diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue index 48fb8a3..efc3edc 100644 --- a/src/views/HelpView.vue +++ b/src/views/HelpView.vue @@ -588,6 +588,7 @@ import { @Component({ components: { QuickNav } }) export default class Help extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $router!: Router; package = Package; commitHash = import.meta.env.VITE_GIT_HASH; @@ -614,7 +615,7 @@ export default class Help extends Vue { finishedOnboarding: false, }); } - (this.$router as Router).push({ name: "home" }); + this.$router.push({ name: "home" }); } } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 0462d44..d7336fc 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -37,8 +37,7 @@ You should see a prompt to install, or you can click on the top-right dots - /> - and then "Install" and then "Install"Android 'install' icon - +
ID: {{ activeDid }} @@ -114,6 +117,7 @@ import { retrieveAllAccountsMetadata } from "../libs/util"; @Component({ components: { QuickNav } }) export default class IdentitySwitcherView extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; + $router!: Router; public activeDid = ""; public activeDidInIdentities = false; @@ -131,7 +135,10 @@ export default class IdentitySwitcherView extends Vue { const accounts = await retrieveAllAccountsMetadata(); for (let n = 0; n < accounts.length; n++) { const acct = accounts[n]; - this.otherIdentities.push({ id: acct.id as string, did: acct.did }); + this.otherIdentities.push({ + id: (acct.id ?? 0).toString(), + did: acct.did, + }); if (acct.did && this.activeDid === acct.did) { this.activeDidInIdentities = true; } @@ -159,7 +166,7 @@ export default class IdentitySwitcherView extends Vue { await db.settings.update(MASTER_SETTINGS_KEY, { activeDid: did, }); - (this.$router as Router).push({ name: "account" }); + this.$router.push({ name: "account" }); } async deleteAccount(id: string) { diff --git a/src/views/ImportAccountView.vue b/src/views/ImportAccountView.vue index d2067ea..328adc6 100644 --- a/src/views/ImportAccountView.vue +++ b/src/views/ImportAccountView.vue @@ -111,6 +111,7 @@ export default class ImportAccountView extends Vue { AppString = AppString; $notify!: (notification: NotificationIface, timeout?: number) => void; + $router!: Router; apiServer = ""; address = ""; @@ -130,7 +131,7 @@ export default class ImportAccountView extends Vue { } public onCancelClick() { - (this.$router as Router).back(); + this.$router.back(); } public isNotProdServer() { @@ -170,7 +171,7 @@ export default class ImportAccountView extends Vue { await db.settings.update(MASTER_SETTINGS_KEY, { activeDid: newId.did, }); - (this.$router as Router).push({ name: "account" }); + this.$router.push({ name: "account" }); // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (err: any) { console.error("Error saving mnemonic & updating settings:", err); diff --git a/src/views/ImportDerivedAccountView.vue b/src/views/ImportDerivedAccountView.vue index eaf7790..bb46515 100644 --- a/src/views/ImportDerivedAccountView.vue +++ b/src/views/ImportDerivedAccountView.vue @@ -70,7 +70,7 @@ diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 0579bd2..9beded7 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -8,7 +8,7 @@