Skip to content

Commit

Permalink
Add dropdown listener once (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceDBorn authored Oct 26, 2023
1 parent 7eb8dbf commit 529a047
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extension/scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ const message = document.getElementById('message')
const buttonGroup = document.getElementById('btn-group')
const shareStopBtn = document.getElementById('share-stop-btn')
let shareStopBtnState = null

let nodesLoop = null

dropdown.addEventListener('change', () => {
setSelectedNode(dropdown.value)
chrome.runtime.sendNativeMessage(MESSAGE_NAME, { cmd: 'SetSharingNode', args: [{ node: selectedNode, micId }] })
})

let selectedNode = null
function setSelectedNode (id) {
selectedNode = id
Expand Down Expand Up @@ -206,10 +210,6 @@ async function populateNodesList (response) {
}

selectedNode = dropdown.value
dropdown.addEventListener('change', () => {
setSelectedNode(dropdown.value)
chrome.runtime.sendNativeMessage(MESSAGE_NAME, { cmd: 'SetSharingNode', args: [{ node: selectedNode, micId }] })
})
}
}

Expand Down

0 comments on commit 529a047

Please sign in to comment.