Fix sidebar routerPath

This commit is contained in:
Thomas Ricouard 2023-09-17 09:19:18 +02:00
parent 4dcc8a6b23
commit 194b36590f
2 changed files with 4 additions and 3 deletions

View file

@ -111,8 +111,7 @@ struct IceCubesApp: App {
private var sidebarView: some View {
SideBarView(selectedTab: $selectedTab,
popToRootTab: $popToRootTab,
tabs: availableTabs,
routerPath: sidebarRouterPath)
tabs: availableTabs)
{
GeometryReader { _ in
HStack(spacing: 0) {
@ -146,6 +145,7 @@ struct IceCubesApp: App {
}.onChange(of: $appAccountsManager.currentAccount.id) {
sideBarLoadedTabs.removeAll()
}
.environment(sidebarRouterPath)
}
private var notificationsSecondaryColumn: some View {

View file

@ -11,11 +11,11 @@ struct SideBarView<Content: View>: View {
@EnvironmentObject private var theme: Theme
@Environment(StreamWatcher.self) private var watcher
@EnvironmentObject private var userPreferences: UserPreferences
@Environment(RouterPath.self) private var routerPath
@Binding var selectedTab: Tab
@Binding var popToRootTab: Tab
var tabs: [Tab]
@State var routerPath = RouterPath()
@ViewBuilder var content: () -> Content
private func badgeFor(tab: Tab) -> Int {
@ -122,6 +122,7 @@ struct SideBarView<Content: View>: View {
}
var body: some View {
@Bindable var routerPath = routerPath
HStack(spacing: 0) {
ScrollView {
VStack(alignment: .center) {