diff --git a/Sources/Screens/Browser/BrowserStore.swift b/Sources/Screens/Browser/BrowserStore.swift index 3f91834..f39354c 100644 --- a/Sources/Screens/Browser/BrowserStore.swift +++ b/Sources/Screens/Browser/BrowserStore.swift @@ -20,7 +20,7 @@ class BrowserStore: ObservableObject { @Published var folder: VOFile.Entity? @Published var folderIsLoading: Bool = false @Published var folderError: String? - @Published var query: VOFile.Query? + @Published var query: VOFile.Query = .init(type: .folder) private var list: VOFile.List? private var cancellables = Set() private var timer: Timer? @@ -44,7 +44,11 @@ class BrowserStore: ObservableObject { .debounce(for: .seconds(1), scheduler: RunLoop.main) .removeDuplicates() .sink { - self.query = .init(text: $0, type: .folder) + if $0.isEmpty { + self.query = .init(type: .folder) + } else { + self.query = .init(text: $0, type: .folder) + } } .store(in: &cancellables) } diff --git a/Sources/Screens/Viewer/Mosaic/ViewerMosaic.swift b/Sources/Screens/Viewer/Mosaic/ViewerMosaic.swift index 640b970..71d5a66 100644 --- a/Sources/Screens/Viewer/Mosaic/ViewerMosaic.swift +++ b/Sources/Screens/Viewer/Mosaic/ViewerMosaic.swift @@ -25,111 +25,116 @@ struct ViewerMosaic: View { } var body: some View { - if file.type == .file, - let snapshot = file.snapshot, - let download = snapshot.preview, - let fileExtension = download.fileExtension, fileExtension.isImage(), snapshot.mosaic != nil - { - GeometryReader { geometry in - let visibleRect = CGRect( - origin: CGPoint(x: -dragOffset.width, y: -dragOffset.height), - size: geometry.size - ) - ZStack { - if let zoomLevel = viewerMosaicStore.zoomLevel, !viewerMosaicStore.grid.isEmpty { - ForEach(0..