Skip to content

Commit

Permalink
v0.0.67
Browse files Browse the repository at this point in the history
  • Loading branch information
therockerline committed May 13, 2024
1 parent 7ae2f19 commit c71483a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nethlink",
"version": "0.0.66",
"version": "0.0.67",
"description": "Neth Connector app",
"main": "./out/main/main.js",
"license": "UNLICENSED",
Expand Down
1 change: 1 addition & 0 deletions src/main/classes/controllers/PhoneIslandController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class PhoneIslandController {
const window = this.window.getWindow()
window?.setBounds({ width: w, height: h }, false)
window?.show()
window?.setAlwaysOnTop(true)
} catch (e) {
log(e)
}
Expand Down
22 changes: 13 additions & 9 deletions src/renderer/src/components/NumberCaller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ type NumberCallerProps = {
}
export const NumberCaller = ({ number, children, disabled, className, ...args }: NumberCallerProps) => {
return (

<a href={`callto://${('' + number).replace(/ /g, '')}`}
className={ClassNames(
disabled ? 'pointer-events-none' : '',
className
)}
{...args}>
{children}
</a>
disabled ?
<div className={ClassNames(
className,
'cursor-not-allowed',
)}>{children}</div>
:
<a href={`callto://${('' + number).replace(/ /g, '')}`}
className={ClassNames(
className,
)}
{...args}>
{children}
</a>
)
}
10 changes: 8 additions & 2 deletions src/renderer/src/components/SearchNumberBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { log } from '@shared/utils/logger'
import { sortByProperty } from '@renderer/lib/utils'
import { useSubscriber } from '@renderer/hooks/useSubscriber'
import { cloneDeep } from 'lodash'
import { useAccount } from '@renderer/hooks/useAccount'

export interface SearchNumberBoxProps {
searchText: string
Expand All @@ -23,6 +24,7 @@ export function SearchNumberBox({
}: SearchNumberBoxProps) {
const [filteredPhoneNumbers, setFilteredPhoneNumbers] = useState<SearchData[]>([])
const [unFilteredPhoneNumbers, setUnFilteredPhoneNumbers] = useState<SearchData[]>([])
const { isCallsEnabled } = useAccount()

useInitialize(() => {
window.api.onSearchResult(saveUnfiltered)
Expand Down Expand Up @@ -85,8 +87,12 @@ export function SearchNumberBox({
return (
<div className="flex flex-col dark:text-gray-50 text-gray-900 dark:bg-gray-900 bg-gray-50">
<div
className="flex gap-5 pt-[10px] pr-8 pb-[10px] pl-7 min-h-9 items-start dark:hover:bg-gray-800 hover:bg-gray-200 cursor-pointer"
onClick={() => callUser(searchText)}
className={`flex gap-5 pt-[10px] pr-8 pb-[10px] pl-7 min-h-9 items-start dark:hover:bg-gray-800 hover:bg-gray-200 ${isCallsEnabled ? 'cursor-pointer' : 'cursor-not-allowed'}`}

onClick={() => {
if (isCallsEnabled)
callUser(searchText)
}}
>
<FontAwesomeIcon
className="text-base dark:text-gray-50 text-gray-600 mr-1"
Expand Down
12 changes: 12 additions & 0 deletions src/renderer/src/pages/PhoneIslandPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useState, useRef, useMemo, useCallback, createRef } from 'react'

export function PhoneIslandPage() {
const [dataConfig, setDataConfig] = useState<string | undefined>()
const isOnCall = useRef<boolean>(false)
const isExpanded = useRef<boolean>(true)
const lastResizeEvent = useRef<PHONE_ISLAND_EVENTS>()
const isMinimized = useRef<boolean>(false)
Expand Down Expand Up @@ -40,6 +41,7 @@ export function PhoneIslandPage() {
case PHONE_ISLAND_EVENTS['phone-island-call-transfered']:
log(event)
window.api.hidePhoneIsland()
isOnCall.current = false
break
case PHONE_ISLAND_EVENTS['phone-island-expanded']:
log(lastResizeEvent.current)
Expand Down Expand Up @@ -80,6 +82,16 @@ export function PhoneIslandPage() {
phoneIslandContainer.current?.children[1].setAttribute('style', '')
break
}
//sono stato chiamato, e la phone island è già visibile. non devo fare altri resize se ricevo nuovi ringing

if (event === PHONE_ISLAND_EVENTS['phone-island-call-ringing']) {
if (!isOnCall.current) {
isOnCall.current = true
} else {
//mi fermo prima
return
}
}
const size = getSizeFromResizeEvent(event)!
window.api.resizePhoneIsland(size.w, size.h)
}
Expand Down

0 comments on commit c71483a

Please sign in to comment.