Skip to content

Commit

Permalink
Update concurrency code
Browse files Browse the repository at this point in the history
  • Loading branch information
milanvarady committed Dec 26, 2024
1 parent 150e74f commit 541f4ce
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Applite/Model/Cask Data/Cask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import SwiftUI
import os
import Combine

/// Holds all essential data of a Homebrew cask and provides methods to run brew commands on it (e.g. install, uninstall, update)
final class Cask: Identifiable, Decodable, Hashable, ObservableObject {
Expand Down
3 changes: 2 additions & 1 deletion Applite/Views/App Views/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ struct AppView: View {
}

if self.role == .installAndManage {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
Task { @MainActor in
try await Task.sleep(for: .seconds(1.5))
withAnimation(.spring(blendDuration: 1)) {
successCheckmarkScale = 0.0001
}
Expand Down
1 change: 0 additions & 1 deletion Applite/Views/Detail Views/DownloadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import SwiftUI
import Fuse
import Combine

/// Download section. Either dispays the `DiscoverView` or search results
struct DownloadView: View {
Expand Down
2 changes: 1 addition & 1 deletion Applite/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct SettingsView: View {
.contentShape(Rectangle())
.onTapGesture {
// Deselect textfield when clicking away
DispatchQueue.main.async {
Task { @MainActor in
NSApp.keyWindow?.makeFirstResponder(nil)
}
}
Expand Down

0 comments on commit 541f4ce

Please sign in to comment.