From 783b38df65f1a689cc76b9853cbf3b0df51e78a5 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 18 Feb 2024 14:58:10 -0700 Subject: [PATCH] order contacts by name & note outside network as "outside your network" --- src/libs/endorserServer.ts | 4 ++-- src/views/ContactGiftingView.vue | 2 +- src/views/ContactsView.vue | 12 ++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index c2168fe0..45ad00ac 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -373,8 +373,8 @@ export function didInfo( return myId ? `You${myId !== activeDid ? " (Alt ID)" : ""}` : isHiddenDid(did) - ? "Someone Not In Network" - : "Someone Not In Contacts"; + ? "Someone Outside Your Network" + : "Someone Outside Contacts"; } } diff --git a/src/views/ContactGiftingView.vue b/src/views/ContactGiftingView.vue index baaf0a0b..9cb7849a 100644 --- a/src/views/ContactGiftingView.vue +++ b/src/views/ContactGiftingView.vue @@ -118,7 +118,7 @@ export default class ContactGiftingView extends Vue { const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings; this.apiServer = settings?.apiServer || ""; this.activeDid = settings?.activeDid || ""; - this.allContacts = await db.contacts.toArray(); + this.allContacts = await db.contacts.orderBy("name").toArray(); localStorage.removeItem("projectId"); diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index ed9f19a9..b6630548 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -364,11 +364,7 @@ export default class ContactsView extends Vue { if (this.showGiveNumbers) { this.loadGives(); } - const allContacts = await db.contacts.toArray(); - this.contacts = R.sort( - (a: Contact, b) => (a.name || "").localeCompare(b.name || ""), - allContacts, - ); + this.contacts = await db.contacts.orderBy("name").toArray(); if (this.contactEndorserUrl) { await this.addContactFromScan(this.contactEndorserUrl); @@ -576,11 +572,7 @@ export default class ContactsView extends Vue { -1, ); } - const allContacts = await db.contacts.toArray(); - this.contacts = R.sort( - (a: Contact, b) => (a.name || "").localeCompare(b.name || ""), - allContacts, - ); + this.contacts = await db.contacts.orderBy("name").toArray(); return; }