File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ struct ChangesView: View {
1919 var peer : SushitrainPeer ?
2020 }
2121
22+ @ObservedObject var userSettings : AppUserSettings
23+
2224 @State private var changes : [ ChangeInfo ] = [ ]
2325 @Environment ( AppState . self) private var appState
2426
@@ -69,6 +71,11 @@ struct ChangesView: View {
6971 . task {
7072 await self . update ( )
7173 }
74+ . onChange ( of: userSettings. hideHiddenFolders) { _, _ in
75+ Task {
76+ await self . update ( )
77+ }
78+ }
7279 . onChange ( of: appState. lastChanges) { _, _ in
7380 Task {
7481 await self . update ( )
@@ -121,8 +128,11 @@ struct ChangesView: View {
121128 #endif
122129
123130 private func update( ) async {
124- self . changes = appState. lastChanges. map { change in
131+ self . changes = appState. lastChanges. compactMap { change in
125132 let folder = appState. client. folder ( withID: change. folderID)
133+ if let f = folder, f. isHidden == true && userSettings. hideHiddenFolders {
134+ return nil
135+ }
126136 let entry = try ? folder? . getFileInformation ( change. path)
127137 let peer = appState. client. peer ( withShortID: change. shortID)
128138 return ChangeInfo (
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ struct StartView: View {
398398 self . folderIssuesSection ( )
399399
400400 Section ( " Manage files and folders " ) {
401- NavigationLink ( destination: ChangesView ( ) ) {
401+ NavigationLink ( destination: ChangesView ( userSettings : appState . userSettings ) ) {
402402 Label ( " Recent changes " , systemImage: " clock.arrow.2.circlepath " ) . badge ( changesCount)
403403 } . disabled ( changesCount == 0 )
404404 }
You can’t perform that action at this time.
0 commit comments