git.iko.soy/parseable-macos
on master help sign in
Fix stale stream/filter list shown during server switch
f609dc4iko
ParseableViewer/App/AppState.swift+7
@@ -141,6 +141,13 @@ final class AppState {
141 if activeConnection?.id != connection.id {
141 if activeConnection?.id != connection.id {
142 selectedStream = nil
142 selectedStream = nil
143 streamLoadError = nil
143 streamLoadError = nil
144+ // Drop the previous server's stream list and filters too — otherwise the
145+ // sidebar keeps rendering server A's streams/filters (with selection
146+ // already nilled) throughout the reconnect window. Same rationale as
147+ // `serverAbout` below; matches the failure path and `disconnect()`. Both
148+ // are repopulated once the new server's listStreams/listFilters respond.
149+ streams = []
150+ filters = []
144 // Drop the previous server's cached `about` so views seeding from it
151 // Drop the previous server's cached `about` so views seeding from it
145 // (ServerInfoView) don't paint the old server's details while the new
152 // (ServerInfoView) don't paint the old server's details while the new
146 // one loads. It's repopulated below once the new server responds.
153 // one loads. It's repopulated below once the new server responds.