Skip to content

Commit

Permalink
Fix run command action settings override
Browse files Browse the repository at this point in the history
fixes #1
  • Loading branch information
j4ckofalltrades committed Nov 17, 2023
1 parent 80049e3 commit 04b2554
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/dev.jduabe.obsideck.sdPlugin/runcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
/// <reference path="libs/js/stream-deck.js" />

/* eslint-disable no-undef */
let settings = {}
let runCommandAction = new Action("dev.jduabe.obsideck.runcommand")

runCommandAction.onWillAppear((event) => {
$SD.getSettings(event.context)
})

runCommandAction.onDidReceiveSettings(({ payload }) => {
settings = payload.settings
})

runCommandAction.onKeyUp(({ context }) => {
const apiKey = settings.apiKey
const commandId = settings.commandId
const url = settings.url
runCommandAction.onKeyUp(({ context, payload }) => {
const apiKey = payload.settings.apiKey
const commandId = payload.settings.commandId
const url = payload.settings.url

fetch(`${url}/commands/${encodeURIComponent(commandId)}/`, {
method: "POST",
Expand Down

0 comments on commit 04b2554

Please sign in to comment.