global: make sure we unsubscribe after each refresh

This commit is contained in:
William Casarin
2022-12-21 12:50:18 -08:00
parent b1d14ff21f
commit 37460f933b
2 changed files with 12 additions and 3 deletions

View File

@@ -85,7 +85,11 @@ struct SearchHomeView: View {
print("search change 1")
}
.onAppear {
model.subscribe()
// TODO: This will always be empty when switching between tabs
// We'll need to store these in
if model.events.isEmpty {
model.subscribe()
}
}
.onDisappear {
model.unsubscribe()