Somewhat working file tray

This commit is contained in:
Hariharan Mudaliar 2025-12-08 13:29:25 +05:30
commit 30422c3d95
29 changed files with 4032 additions and 65 deletions

View file

@ -9,6 +9,7 @@ import Combine
import Defaults
import SwiftUI
@MainActor
class DynamicIslandViewModel: NSObject, ObservableObject {
@ObservedObject var coordinator = DynamicIslandViewCoordinator.shared
@ObservedObject var detector = FullscreenMediaDetector.shared
@ -45,6 +46,7 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
@Published var notchSize: CGSize = getClosedNotchSize()
@Published var closedNotchSize: CGSize = getClosedNotchSize()
@MainActor
deinit {
destroy()
}
@ -282,7 +284,7 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
// Set the current view to shelf if it contains files and the user enables openShelfByDefault
// Otherwise, if the user has not enabled openLastShelfByDefault, set the view to home
if !TrayDrop.shared.isEmpty && Defaults[.openShelfByDefault] {
if !ShelfStateViewModel.shared.isEmpty && Defaults[.openShelfByDefault] {
coordinator.currentView = .shelf
} else if !coordinator.openLastTabByDefault {
coordinator.currentView = .home