Skip to content

Commit

Permalink
fix: answer intercom feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules010209 committed Aug 13, 2024
1 parent 4ebaf42 commit cb9ac42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/components/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { LeftMenu, Menu } from './menu';

const menuData = {
leftMenu: [
{ id: IntercomType.ANSWER, label: 'anwser' },
{ id: IntercomType.ANSWER, label: 'answer' },
{ id: IntercomType.HANGUP, label: 'hangup' },
{ id: IntercomType.REJECT, label: 'reject' },
{ id: 4, label: 'BLK' },
Expand Down Expand Up @@ -50,7 +50,7 @@ const Panel = () => {
window.electron.ipcRenderer.invoke('config', 'positions').then((data: Positions) => {
let initialArray = Array(30).fill({
label: 'XXXX',
frequency: 'XXX.XX',
frequency: 'XXX.XXX',
callsign: 'XXXX_XXX',
color: null
}) as Station[];
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/src/utils/intercom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ interface call {
position: string;
}

interface anwser {
type: "anwser";
interface answer {
type: "answer";
}

interface hangup {
Expand All @@ -15,16 +15,16 @@ interface reject {
type: "reject";
}

type handleFreq = call | anwser | hangup | reject;
type handleFreq = call | answer | hangup | reject;

export const handleIntercom = (props: handleFreq) => {
switch(props.type) {
case 'call': {
window.electron.ipcRenderer.send('send_data', `INTERCOMCALL;${props.position}`);
}
break;
case 'anwser': {
window.electron.ipcRenderer.send('send_data', `INTERCOMANWSER`);
case 'answer': {
window.electron.ipcRenderer.send('send_data', `INTERCOMANSWER`);
}
break;
case 'hangup': {
Expand Down

0 comments on commit cb9ac42

Please sign in to comment.