diff --git a/Yattee/Core/AppEnvironment.swift b/Yattee/Core/AppEnvironment.swift index 22f95eae..e402d12d 100644 --- a/Yattee/Core/AppEnvironment.swift +++ b/Yattee/Core/AppEnvironment.swift @@ -451,6 +451,7 @@ final class AppEnvironment { self.toastManager = toast toast.setNavigationCoordinator(self.navigationCoordinator) remoteControl.setToastManager(toast) + player.setToastManager(toast) self.downloadManager.setToastManager(toast) self.downloadManager.setDownloadSettings(self.downloadSettings) diff --git a/Yattee/Core/InstancesManager.swift b/Yattee/Core/InstancesManager.swift index d41a55c5..078a9024 100644 --- a/Yattee/Core/InstancesManager.swift +++ b/Yattee/Core/InstancesManager.swift @@ -8,16 +8,6 @@ import Foundation import SwiftUI -/// Status of an instance's connectivity and authentication. -enum InstanceStatus: Equatable { - /// Instance is online and working. - case online - /// Instance requires authentication but credentials are not provided. - case authRequired - /// Instance authentication failed (wrong credentials). - case authFailed -} - /// Manages the list of configured backend instances with iCloud sync. @MainActor @Observable @@ -38,9 +28,6 @@ final class InstancesManager { private(set) var instances: [Instance] = [] private(set) var activeInstanceID: UUID? - /// Current status of each instance, keyed by instance ID. - private(set) var instanceStatuses: [UUID: InstanceStatus] = [:] - // MARK: - Initialization /// - Parameter defaults: where the configured instances are read and @@ -319,13 +306,6 @@ final class InstancesManager { } } - // MARK: - Instance Status - - /// Returns the current status of an instance. - func status(for instance: Instance) -> InstanceStatus { - instanceStatuses[instance.id] ?? .online - } - /// The currently active instance for browsing content. /// Falls back to the first enabled instance if no active instance is set. var activeInstance: Instance? { diff --git a/Yattee/Views/Settings/SourcesListView.swift b/Yattee/Views/Settings/SourcesListView.swift index 2f32f357..47fe9757 100644 --- a/Yattee/Views/Settings/SourcesListView.swift +++ b/Yattee/Views/Settings/SourcesListView.swift @@ -415,11 +415,8 @@ struct SourcesListView: View { appEnvironment?.needsCredentials(for: instance) ?? false } - /// Whether one of this source's logins is being refused by the server. - /// - /// The instance-level statuses below know nothing about accounts, so a - /// rejected login would otherwise show up nowhere the user looks for their - /// sources. + /// Whether one of this source's logins is being refused by the server, so a + /// rejected login shows up where the user looks for their sources. private func hasRejectedAccount(_ instance: Instance) -> Bool { guard let accountsManager = appEnvironment?.accountsManager else { return false } @@ -443,19 +440,6 @@ struct SourcesListView: View { Label(String(localized: "sources.status.authRequired"), systemImage: "key.fill") .font(.caption2) .foregroundStyle(.orange) - } else if let status = instancesManager?.status(for: instance) { - switch status { - case .authFailed: - Label(String(localized: "sources.status.authFailed"), systemImage: "exclamationmark.triangle.fill") - .font(.caption2) - .foregroundStyle(.orange) - case .authRequired: - Label(String(localized: "sources.status.authRequired"), systemImage: "key.fill") - .font(.caption2) - .foregroundStyle(.orange) - default: - EmptyView() - } } }