Skip to content

Commit 30e59b9

Browse files
authored
Merge pull request #25 from sproctor/fix/swclose
Don't send `_swclose` on subsequent stream events
2 parents 163b508 + d83f338 commit 30e59b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stormfront/src/main/kotlin/warlockfe/warlock3/stormfront/network/StormfrontClient.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ import java.net.URL
115115
import java.nio.charset.Charset
116116
import java.util.*
117117
import java.util.concurrent.ConcurrentHashMap
118+
import kotlin.collections.set
118119
import kotlin.math.max
119120

120121
const val scriptCommandPrefix = '.'
@@ -469,10 +470,10 @@ class StormfrontClient(
469470

470471
is StormfrontStreamWindowEvent -> {
471472
val window = event.window
472-
addWindow(window)
473-
if (window.id != "main") {
473+
if (windows.get(event.window.id) != null && window.id != "main") {
474474
sendCommandDirect("_swclose s${event.window.id}")
475475
}
476+
addWindow(window)
476477
}
477478

478479
is StormfrontActionEvent -> {

0 commit comments

Comments
 (0)