diff --git a/IceCubesNotifications/NotificationService.swift b/IceCubesNotifications/NotificationService.swift index 9e149f59..25e48996 100644 --- a/IceCubesNotifications/NotificationService.swift +++ b/IceCubesNotifications/NotificationService.swift @@ -9,12 +9,11 @@ import Notifications import UIKit import UserNotifications -@MainActor class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? - override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { + @MainActor override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) @@ -124,6 +123,7 @@ class NotificationService: UNNotificationServiceExtension { } } + @MainActor private func toRemoteNotification(localNotification: MastodonPushNotification) async -> Models.Notification? { do { if let account = AppAccountsManager.shared.availableAccounts.first(where: { $0.oauthToken?.accessToken == localNotification.accessToken }) { @@ -137,6 +137,7 @@ class NotificationService: UNNotificationServiceExtension { return nil } + @MainActor private func buildMessageIntent(remoteNotification: Models.Notification, currentUser: String, avatarURL: URL) -> INSendMessageIntent diff --git a/Packages/Explore/Sources/Explore/ExploreView.swift b/Packages/Explore/Sources/Explore/ExploreView.swift index 193afe69..11d8743a 100644 --- a/Packages/Explore/Sources/Explore/ExploreView.swift +++ b/Packages/Explore/Sources/Explore/ExploreView.swift @@ -108,9 +108,7 @@ public struct ExploreView: View { } } .task(id: viewModel.searchQuery) { - do { - await viewModel.search() - } catch {} + await viewModel.search() } .onChange(of: scrollToTopSignal) { if viewModel.scrollToTopVisible { diff --git a/Packages/Network/Sources/Network/DeepLClient.swift b/Packages/Network/Sources/Network/DeepLClient.swift index 427db35d..9a2c0394 100644 --- a/Packages/Network/Sources/Network/DeepLClient.swift +++ b/Packages/Network/Sources/Network/DeepLClient.swift @@ -1,7 +1,7 @@ import Foundation import Models -public struct DeepLClient { +public struct DeepLClient: Sendable { public enum DeepLError: Error { case notFound } diff --git a/Packages/Network/Sources/Network/InstanceSocialClient.swift b/Packages/Network/Sources/Network/InstanceSocialClient.swift index 4bd23171..8c2530b3 100644 --- a/Packages/Network/Sources/Network/InstanceSocialClient.swift +++ b/Packages/Network/Sources/Network/InstanceSocialClient.swift @@ -1,7 +1,7 @@ import Foundation import Models -public struct InstanceSocialClient { +public struct InstanceSocialClient: Sendable { private let authorization = "Bearer 8a4xx3D7Hzu1aFnf18qlkH8oU0oZ5ulabXxoS2FtQtwOy8G0DGQhr5PjTIjBnYAmFrSBuE2CcASjFocxJBonY8XGbLySB7MXd9ssrwlRHUXTQh3Z578lE1OfUtafvhML" private let listEndpoint = "https://instances.social/api/1.0/instances/list?count=1000&include_closed=false&include_dead=false&min_active_users=500" private let searchEndpoint = "https://instances.social/api/1.0/instances/search" diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/Components/MediaContainer.swift b/Packages/StatusKit/Sources/StatusKit/Editor/Components/MediaContainer.swift index b6906189..02cff14a 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/Components/MediaContainer.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/Components/MediaContainer.swift @@ -5,7 +5,7 @@ import SwiftUI import UIKit extension StatusEditor { - struct MediaContainer: Identifiable { + struct MediaContainer: Identifiable, Sendable { let id: String let image: UIImage? let movieTransferable: MovieFileTranseferable? diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift b/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift index d9b7f35d..7e95ebc3 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/Components/UTTypeSupported.swift @@ -72,7 +72,7 @@ extension StatusEditor { } extension StatusEditor { - final class MovieFileTranseferable: Transferable { + final class MovieFileTranseferable: Transferable, Sendable { let url: URL init(url: URL) { @@ -94,7 +94,7 @@ extension StatusEditor { } } - final class GifFileTranseferable: Transferable { + final class GifFileTranseferable: Transferable, Sendable { let url: URL init(url: URL) { diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift index af3c05d1..0eb9eb75 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/ViewModel.swift @@ -670,7 +670,7 @@ extension StatusEditor { } } - func makeMediaContainer(from pickerItem: PhotosPickerItem) async -> MediaContainer? { + nonisolated func makeMediaContainer(from pickerItem: PhotosPickerItem) async -> MediaContainer? { await withTaskGroup(of: MediaContainer?.self, returning: MediaContainer?.self) { taskGroup in taskGroup.addTask(priority: .high) { await Self.makeImageContainer(from: pickerItem) } taskGroup.addTask(priority: .high) { await Self.makeGifContainer(from: pickerItem) }