fix: add running guards to prevent concurrent toggleProcess/exitNodeProcess
Rapid clicks or slow ops no longer spawn duplicate tailscale invocations. Matches existing pattern used for copyProcess safety. Fixes #15
This commit is contained in:
parent
42d3bef5c6
commit
b6ead317e1
1 changed files with 2 additions and 0 deletions
|
|
@ -114,12 +114,14 @@ PluginComponent {
|
|||
}
|
||||
|
||||
function toggleTailscale() {
|
||||
if (toggleProcess.running) return
|
||||
root._pendingToggleAction = root.isConnected ? "disconnect" : "connect"
|
||||
toggleProcess.command = TailscaleLib.buildToggleCommand(root.isConnected)
|
||||
toggleProcess.running = true
|
||||
}
|
||||
|
||||
function setExitNode(hostname) {
|
||||
if (exitNodeProcess.running) return
|
||||
exitNodeProcess.command = TailscaleLib.makeExitNodeCommand(hostname)
|
||||
exitNodeProcess.running = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue