mirror of
https://github.com/jambonz/chrome-extension-dialer.git
synced 2026-01-25 02:08:05 +00:00
show calls in alphabetic order
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
|||||||
SipClientStatus,
|
SipClientStatus,
|
||||||
} from "src/common/types";
|
} from "src/common/types";
|
||||||
import { SipConstants, SipUA } from "src/lib";
|
import { SipConstants, SipUA } from "src/lib";
|
||||||
import IncommingCall from "./incomming-call";
|
import IncommingCall from "./incoming-call";
|
||||||
import DialPad from "./dial-pad";
|
import DialPad from "./dial-pad";
|
||||||
import {
|
import {
|
||||||
isSipClientAnswered,
|
isSipClientAnswered,
|
||||||
@@ -551,8 +551,9 @@ export const Phone = ({
|
|||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
getRegisteredUser()
|
getRegisteredUser()
|
||||||
.then(({ json }) => {
|
.then(({ json }) => {
|
||||||
|
const sortedUsers = json.sort((a, b) => a.localeCompare(b));
|
||||||
resolve(
|
resolve(
|
||||||
json
|
sortedUsers
|
||||||
.filter((u) => !u.includes(sipUsername))
|
.filter((u) => !u.includes(sipUsername))
|
||||||
.map((u) => {
|
.map((u) => {
|
||||||
const uName = u.match(/(^.*)@.*/);
|
const uName = u.match(/(^.*)@.*/);
|
||||||
@@ -586,8 +587,9 @@ export const Phone = ({
|
|||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
getQueues()
|
getQueues()
|
||||||
.then(({ json }) => {
|
.then(({ json }) => {
|
||||||
|
const sortedQueues = json.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
resolve(
|
resolve(
|
||||||
json.map((q) => ({
|
sortedQueues.map((q) => ({
|
||||||
name: `${q.name} (${q.length})`,
|
name: `${q.name} (${q.length})`,
|
||||||
value: q.name,
|
value: q.name,
|
||||||
}))
|
}))
|
||||||
@@ -616,8 +618,9 @@ export const Phone = ({
|
|||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
getApplications()
|
getApplications()
|
||||||
.then(({ json }) => {
|
.then(({ json }) => {
|
||||||
|
const sortedApps = json.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
resolve(
|
resolve(
|
||||||
json.map((a) => ({
|
sortedApps.map((a) => ({
|
||||||
name: a.name,
|
name: a.name,
|
||||||
value: a.application_sid,
|
value: a.application_sid,
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user