Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/classes/controllers/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export class AccountController {
log('On logout account', account?.username, { isSoft })
const API = NethVoiceAPI.api()
try {
if (!isSoft)
await PhoneIslandController.instance.logout(account!)
//if (!isSoft)
await PhoneIslandController.instance.logout(account!)
await API.Authentication.logout()
log(`${account!.username} logout succesfully`)
} catch (e) {
Expand Down
13 changes: 8 additions & 5 deletions src/renderer/src/components/SearchNumberBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ export function SearchNumberBox({
return as < bs ? -1 : as > bs ? 1 : 0
}
})
const mappedOperators: SearchData[] = filteredOperators.map((o) => {
const id = o?.endpoints?.['extension']?.[0]?.['id']
const getId = (o) => parseInt(o?.endpoints?.['extension']?.[0]?.['id']) || -1
const mappedOperators: SearchData[] = filteredOperators.filter((o) => getId(o) !== -1).map((o) => {
const id = getId(o)
return {
...o,
cellphone: o?.endpoints?.['cellphone']?.[0]?.['id'],
Expand All @@ -136,7 +137,7 @@ export function SearchNumberBox({
homepostalcode: '',
homeprovince: '',
homestreet: '',
id: id ? parseInt(id) : -1,
id: id,
notes: '',
owner_id: '',
source: '',
Expand Down Expand Up @@ -199,13 +200,15 @@ export function SearchNumberBox({
setCanAddToPhonebook(() => _canAddInPhonebook)
}

const isCallButtonEnabled = isCallsEnabled && getIsPhoneNumber(searchText) && searchText.length > 1

return (
<div className="flex flex-col dark:text-titleDark text-titleLight dark:bg-bgDark bg-bgLight">
<div
className={`flex gap-5 pt-[10px] pr-8 pb-[10px] pl-7 min-h-9 items-start ${isCallsEnabled && getIsPhoneNumber(searchText) ? 'cursor-pointer dark:hover:bg-hoverDark hover:bg-hoverLight' : 'dark:bg-hoverDark bg-hoverLight opacity-50 cursor-not-allowed'}`}
className={`flex gap-5 pt-[10px] pr-8 pb-[10px] pl-7 min-h-9 items-start ${isCallButtonEnabled ? 'cursor-pointer dark:hover:bg-hoverDark hover:bg-hoverLight' : 'dark:bg-hoverDark bg-hoverLight opacity-50 cursor-not-allowed'}`}

onClick={() => {
if (isCallsEnabled && getIsPhoneNumber(searchText))
if (isCallButtonEnabled)
callUser(searchText)
}}
>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/pages/NethLinkPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export function NethLinkPage({ themeMode }: NethLinkPageProps) {
//log('USERAGENT', navigator.userAgent.includes('Linux'))
}, true)
useEffect(() => {
const isPhoneNumber = getIsPhoneNumber(search)
//const isPhoneNumber = getIsPhoneNumber(search)
//la ricerca é abilitata squando maggiore di due caratteri per i numeri e maggiore di 3 caratteri per il resto
if (search.length > (isPhoneNumber ? 2 : 3)) {
if (search.length >= 3) {
debouncer(
'search',
() => {
Expand Down