mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-29 08:04:32 +00:00
implement download feature
This commit is contained in:
parent
805f367c44
commit
fc82d5fe05
10 changed files with 533 additions and 78 deletions
|
|
@ -201,11 +201,14 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
didSet {
|
||||
if expandingView.show {
|
||||
expandingViewTask?.cancel()
|
||||
let duration: TimeInterval = (expandingView.type == .download ? 2 : 3)
|
||||
expandingViewTask = Task { [weak self] in
|
||||
try? await Task.sleep(for: .seconds(duration))
|
||||
guard let self = self, !Task.isCancelled else { return }
|
||||
self.toggleExpandingView(status: false, type: .battery)
|
||||
// Only auto-hide for battery, not for downloads (DownloadManager handles that)
|
||||
if expandingView.type != .download {
|
||||
let duration: TimeInterval = 3
|
||||
expandingViewTask = Task { [weak self] in
|
||||
try? await Task.sleep(for: .seconds(duration))
|
||||
guard let self = self, !Task.isCancelled else { return }
|
||||
self.toggleExpandingView(status: false, type: .battery)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
expandingViewTask?.cancel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue