Skip to content

Commit 83910fb

Browse files
fix: add nullish check on draggingWindows and on deviceIcon (#44)
1 parent 06433e4 commit 83910fb

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@nethesis/nethesis-brands-svg-icons": "github:nethesis/Font-Awesome#ns-brands",
5050
"@nethesis/nethesis-light-svg-icons": "github:nethesis/Font-Awesome#ns-light",
5151
"@nethesis/nethesis-solid-svg-icons": "github:nethesis/Font-Awesome#ns-solid",
52-
"@nethesis/phone-island": "^0.8.40",
52+
"@nethesis/phone-island": "^0.8.43",
5353
"@tailwindcss/forms": "^0.5.7",
5454
"@types/lodash": "^4.14.202",
5555
"@types/node": "^18.19.9",

src/main/lib/ipcEvents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function registerIpcEvents() {
101101
const startWindowPosition = {
102102
x, y
103103
}
104-
if (!draggingWindows.hasOwnProperty(window.title)) {
104+
if (!draggingWindows?.hasOwnProperty(window.title)) {
105105
const interval: number = setInterval(() => {
106106
updateWindowPosition(window)
107107
}, 1000 / 60) as unknown as number; // => 60 frames per seconds
@@ -119,7 +119,7 @@ export function registerIpcEvents() {
119119

120120
ipcMain.on(IPC_EVENTS.STOP_DRAG, (event) => {
121121
const window = BrowserWindow.fromWebContents(event.sender);
122-
if (window && draggingWindows.hasOwnProperty(window.title)) {
122+
if (window && draggingWindows?.hasOwnProperty(window.title)) {
123123
const draggingWindow = draggingWindows[window.title]
124124
clearInterval(draggingWindow.interval)
125125
delete draggingWindows[window.title]

src/renderer/src/components/Modules/NethVoice/BaseModule/ProfileDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const ProfileDialog = ({
103103
onClick={() => setSelectedMenu(() => MenuItem.device)}
104104
label={t("TopBar.Pair device")}
105105
{...(
106-
deviceIcon.hasOwnProperty('Icon') ? {
106+
deviceIcon?.hasOwnProperty('Icon') ? {
107107
iconElem: (deviceIcon as { Icon: JSX.Element }).Icon
108108
}
109109
: {

src/renderer/src/components/pageComponents/phoneIsland/phoneIslandContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const PhoneIslandContainer = ({ dataConfig, deviceInformationObject, isDa
1818
if (deviceInformationObject) {
1919
Log.info('FORCE DEFAULT DEVICE TO NETHLINK')
2020
//TODO: controlla
21-
window.electron.send(IPC_EVENTS.CHANGE_DEFAULT_DEVICE, deviceInformationObject)
21+
if(account?.data?.default_device?.type === 'webrtc') {
22+
window.electron.send(IPC_EVENTS.CHANGE_DEFAULT_DEVICE, deviceInformationObject)
23+
}
2224
// await NethVoiceAPI.User.default_device(deviceInformationObject)
2325
// eventDispatch(PHONE_ISLAND_EVENTS['phone-island-default-device-change'], { deviceInformationObject })
2426

0 commit comments

Comments
 (0)