Fix crash caused by tab navigation

This commit is contained in:
Arkadiusz Fal 2021-11-30 23:58:46 +01:00
parent c6f077dcd3
commit 52ab162a6c

View File

@ -72,8 +72,10 @@ struct AppTabNavigation: View {
} }
.tag(TabSelection.search) .tag(TabSelection.search)
} }
.id(accounts.current?.id ?? "")
.environment(\.navigationStyle, .tab) .environment(\.navigationStyle, .tab)
.sheet(isPresented: $navigation.presentingChannel, onDismiss: { .background(
EmptyView().sheet(isPresented: $navigation.presentingChannel, onDismiss: {
if let channel = recents.presentedChannel { if let channel = recents.presentedChannel {
recents.close(RecentItem(from: channel)) recents.close(RecentItem(from: channel))
} }
@ -87,7 +89,9 @@ struct AppTabNavigation: View {
} }
} }
} }
.sheet(isPresented: $navigation.presentingPlaylist, onDismiss: { )
.background(
EmptyView().sheet(isPresented: $navigation.presentingPlaylist, onDismiss: {
if let playlist = recents.presentedPlaylist { if let playlist = recents.presentedPlaylist {
recents.close(RecentItem(from: playlist)) recents.close(RecentItem(from: playlist))
} }
@ -100,6 +104,7 @@ struct AppTabNavigation: View {
} }
} }
} }
)
} }
private var subscriptionsVisible: Bool { private var subscriptionsVisible: Bool {