Skip to content

Commit 6b360f1

Browse files
committed
fix: parked call timer alignment;
fix linux startup error; fix showed name on speeddials and lascalls;
1 parent 1038019 commit 6b360f1

File tree

6 files changed

+38
-13
lines changed

6 files changed

+38
-13
lines changed

src/main/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ function attachThemeChangeListener() {
426426
store.set('theme', updatedSystemTheme)
427427
}
428428
//update theme state on the store
429-
TrayController.instance.changeIconByTheme(updatedSystemTheme)
429+
TrayController.instance?.changeIconByTheme(updatedSystemTheme)
430430
})
431431
}
432432
/**

src/renderer/src/components/Modules/NethVoice/LastCalls/LastCall.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,27 @@ export function LastCall({
9393
showContactForm()
9494
}
9595

96+
const getCallName = (call: LastCallData) => {
97+
return `${call.direction === 'in'
98+
? (call.src || call.ccompany || t('Common.Unknown'))
99+
: call.direction === 'out'
100+
? (call.dst_cnam || call.dst_ccompany || t('Common.Unknown'))
101+
: t('Common.Unknown')
102+
}`
103+
}
104+
96105
return (
97106
<div className="group">
98107
<div
99108
className={`flex flex-grow gap-3 min-h-[72px] p-2 ${className}`}
100109
onMouseEnter={() => {
101-
if (call.username === t('Common.Unknown')) {
110+
if (
111+
call.direction === 'in'
112+
? !(call.src || call.ccompany)
113+
: call.direction === 'out'
114+
? !(call.dst_cnam || call.dst_ccompany)
115+
: false
116+
) {
102117
setShowCreateButton(() => true)
103118
}
104119
}}
@@ -130,7 +145,7 @@ export function LastCall({
130145
</div>
131146
<div className="flex flex-col gap-1 dark:text-titleDark text-titleLight">
132147
<p className={`tooltip-username-${call?.username} font-medium text-[14px] leading-5`}>
133-
{truncate(call.username, 13)}
148+
{truncate(getCallName(call), 13)}
134149
</p>
135150
<Tooltip anchorSelect={`.tooltip-username-${call?.username}`}>{call.username}</Tooltip>
136151
<div className="flex flex-row gap-2 items-center">

src/renderer/src/components/Modules/NethVoice/LastCalls/LastCallsBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function LastCallsBox({ showContactForm }): JSX.Element {
5454
operator = Object.values(operators?.operators || {}).find((operator: any) => operator.name === callName)
5555
} else {
5656
operator = Object.values(operators?.operators || {}).find((operator: any) => {
57-
const isExten = operator.endpoints.extension.find((exten: any) => exten.id === call.dst)
57+
const isExten = operator.endpoints?.extension?.find((exten: any) => exten.id === call.dst)
5858
return isExten ? true : false
5959
})
6060
}

src/renderer/src/components/Modules/NethVoice/Parking/ParkedCall.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Account, ParkingType } from "@shared/types";
1+
import { ParkingType } from "@shared/types";
22
import {
33
faSquareParking as ParkedCallIcon,
44
faPhone as CallIcon
@@ -8,11 +8,8 @@ import { Button } from "@renderer/components/Nethesis";
88
import { t } from "i18next";
99
import { motion } from 'framer-motion'
1010
import { useEffect, useRef, useState } from "react";
11-
import { isEmpty } from "lodash";
12-
import { useAccount } from "@renderer/hooks/useAccount";
13-
import { useStoreState } from "@renderer/store";
14-
import { useLoggedNethVoiceAPI } from "@renderer/hooks/useLoggedNethVoiceAPI";
1511
import classNames from "classnames";
12+
import { Tooltip } from 'react-tooltip'
1613

1714
export interface ParkingCallProps {
1815
parkingDetails: ParkingType,
@@ -81,13 +78,25 @@ export const ParkedCall = ({ parkingDetails, onPickup }: ParkingCallProps) => {
8178
<div className="absolute flex flex-col justify-start gap-0 w-full top-0 left-0">
8279
<div className="flex flex-row items-center text-sm text-textYellowLight dark:text-textYellowDark gap-2">
8380
<FontAwesomeIcon size="1x" icon={ParkedCallIcon} className="text-[14px]" />
84-
<span>
81+
<span className={`text-sm text-left truncate tooltip-parked-title-${parkingDetails.name}`}>
8582
{t('Parks.Parking')} {parkingDetails.name}
8683
</span>
84+
<Tooltip anchorSelect={`.tooltip-parked-title-${parkingDetails.name}`} place="bottom"
85+
className="z-[100000]"
86+
opacity={1}
87+
noArrow={false}>
88+
{t('Parks.Parking')} {parkingDetails.name}
89+
</Tooltip>
8790
</div>
88-
<span className='text-sm text-left text-gray-900 dark:text-gray-100 truncate tooltip-parked-user '>
91+
<span className={`text-sm text-left text-gray-900 dark:text-gray-100 truncate tooltip-parked-user-${parkingDetails.name} `}>
8992
{parkingDetails?.parkedCaller?.name}
9093
</span>
94+
<Tooltip anchorSelect={`.tooltip-parked-user-${parkingDetails.name}`} place="bottom"
95+
className="z-[100000]"
96+
opacity={1}
97+
noArrow={false}>
98+
{parkingDetails?.parkedCaller?.name}
99+
</Tooltip>
91100
</div>
92101
</div>
93102
<div className="flex flex-row justify-end gap-6 items-center min-w-[200px] min-h-[44px]">

src/renderer/src/components/Modules/NethVoice/Parking/ParkingBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const ParkingBox = () => {
4444
<ModuleTitle
4545
title={`${t('Parks.Parking')} ${parkedCalls && parkedCalls.length > 0 ? `(${parkedCalls.length})` : ''}`}
4646
/>
47-
<Scrollable innerClassName={'min-w-[344px]'}>
47+
<Scrollable innerClassName={'min-w-[344px] mt-2'}>
4848
{parkedCalls ? (
4949
parkedCalls.length > 0 ? (
5050
parkedCalls?.map((e, idx) => {

src/renderer/src/components/Modules/NethVoice/Parking/hook/useParkingModule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export const useParkingModule = () => {
1414

1515

1616
const extractValidParkedCalls = (parkedCalls: ParkingType[]) => {
17+
1718
setValidParkedCalls(() => [
18-
...(parkedCalls?.filter((p) => !!p.parkedCaller.name) || [])
19+
...(parkedCalls?.filter((p) => !!p.parkedCaller.name) || []),
1920
]
2021
)
2122
}

0 commit comments

Comments
 (0)