From 7a59969369885093770510f8409ecb0e890ce418 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 8 Nov 2023 12:38:28 -0500 Subject: [PATCH] show calls in alphabetic order --- .../phone/{incomming-call.tsx => incoming-call.tsx} | 0 src/window/phone/index.tsx | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) rename src/window/phone/{incomming-call.tsx => incoming-call.tsx} (100%) diff --git a/src/window/phone/incomming-call.tsx b/src/window/phone/incoming-call.tsx similarity index 100% rename from src/window/phone/incomming-call.tsx rename to src/window/phone/incoming-call.tsx diff --git a/src/window/phone/index.tsx b/src/window/phone/index.tsx index d1a2758..82362d4 100644 --- a/src/window/phone/index.tsx +++ b/src/window/phone/index.tsx @@ -31,7 +31,7 @@ import { SipClientStatus, } from "src/common/types"; import { SipConstants, SipUA } from "src/lib"; -import IncommingCall from "./incomming-call"; +import IncommingCall from "./incoming-call"; import DialPad from "./dial-pad"; import { isSipClientAnswered, @@ -551,8 +551,9 @@ export const Phone = ({ (resolve, reject) => { getRegisteredUser() .then(({ json }) => { + const sortedUsers = json.sort((a, b) => a.localeCompare(b)); resolve( - json + sortedUsers .filter((u) => !u.includes(sipUsername)) .map((u) => { const uName = u.match(/(^.*)@.*/); @@ -586,8 +587,9 @@ export const Phone = ({ (resolve, reject) => { getQueues() .then(({ json }) => { + const sortedQueues = json.sort((a, b) => a.name.localeCompare(b.name)); resolve( - json.map((q) => ({ + sortedQueues.map((q) => ({ name: `${q.name} (${q.length})`, value: q.name, })) @@ -616,8 +618,9 @@ export const Phone = ({ (resolve, reject) => { getApplications() .then(({ json }) => { + const sortedApps = json.sort((a, b) => a.name.localeCompare(b.name)); resolve( - json.map((a) => ({ + sortedApps.map((a) => ({ name: a.name, value: a.application_sid, }))