Skip to content

Commit

Permalink
1.2.8; Fix PTT. Changing PTT key in UI broken
Browse files Browse the repository at this point in the history
  • Loading branch information
khlam committed Mar 11, 2022
1 parent 52a43cb commit 1a65d0a
Show file tree
Hide file tree
Showing 4 changed files with 961 additions and 1,319 deletions.
16 changes: 3 additions & 13 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,6 @@ let settingsWindow

let devMode = false
let selfMute = false
let isConnected = false
let webViewSession = null
//let isTalking = false
let muteTimeout = null
Expand Down Expand Up @@ -188,7 187,7 @@ function setPTTKey() {
}

ioHook.on(pttEnable, event => {
if (event[pttWatch] == configObj.key && (micPermissionGranted === true) && (isConnected === true) && (isChangingPTTKey === false)) {
if (event[pttWatch] == configObj.key && (micPermissionGranted === true) && (isChangingPTTKey === false)) {
clearTimeout(muteTimeout)
unmuteMic()
}
Expand Down Expand Up @@ -309,12 308,6 @@ ipcMain.on('asynchronous-message', (event, _data) => {
if (micPermissionGranted === false && selfMute === false){
micPermissionGranted = true
}
isConnected = true
}

if (msg === 'disconnected') {
console.log("User disconnected to Discord VOIP server")
isConnected = false
}

if (msg === 'self-muted') {
Expand All @@ -334,8 327,6 @@ ipcMain.on('asynchronous-message', (event, _data) => {
}

if (msg === 'confirmMicClose') {
//if (isTalking === true) {
//console.log("Mic state desync. Opening Mic.")
unmuteMic()
//}
}
Expand Down Expand Up @@ -496,9 487,8 @@ app.on('ready', event => {
})
.then(configObj => {
console.log(configObj)
restartioHook().then(() => {
setPTTKey()
})
ioHook.start()
setPTTKey()
})
})

Loading

0 comments on commit 1a65d0a

Please sign in to comment.