Parcourir la source

Clear sidebar selection when the Settings page is open.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 il y a 1 mois
Parent
commit
11c285e642
2 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 1 0
      gramora/Views/MainView.swift
  2. 2 1
      gramora/Views/SidebarView.swift

+ 1 - 0
gramora/Views/MainView.swift

@@ -20,6 +20,7 @@ struct MainView: View {
                                 viewModel.hideSettings()
                             }
                         ),
+                        isShowingSettings: viewModel.isShowingSettings,
                         isPremium: subscriptions.hasPremiumAccess,
                         onUpgradeTapped: viewModel.showPaywall,
                         onManageSubscriptionTapped: viewModel.showPaywall

+ 2 - 1
gramora/Views/SidebarView.swift

@@ -2,6 +2,7 @@ import SwiftUI
 
 struct SidebarView: View {
     @Binding var selectedDestination: NavigationDestination
+    let isShowingSettings: Bool
     let isPremium: Bool
     let onUpgradeTapped: () -> Void
     let onManageSubscriptionTapped: () -> Void
@@ -17,7 +18,7 @@ struct SidebarView: View {
                 ForEach(NavigationDestination.allCases) { destination in
                     SidebarNavItem(
                         destination: destination,
-                        isSelected: selectedDestination == destination
+                        isSelected: !isShowingSettings && selectedDestination == destination
                     ) {
                         selectedDestination = destination
                     }