From 6bcbc0ac07667b6f05a6025fff9867b2191ce519 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Wed, 14 Feb 2024 16:52:27 +0100 Subject: [PATCH] Remove obsolete code (IOS-192) --- ...omeTimelineViewModel+LoadLatestState.swift | 2 -- Mastodon/Supporting Files/SceneDelegate.swift | 3 --- .../Service/InstanceService.swift | 20 ------------------- 3 files changed, 25 deletions(-) diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift index ff24f74bd..a88bafebe 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift @@ -100,8 +100,6 @@ extension HomeTimelineViewModel.LoadLatestState { await enter(state: Idle.self) viewModel.homeTimelineNavigationBarTitleViewModel.receiveLoadingStateCompletion(.finished) - viewModel.context.instanceService.updateMutesAndBlocks() - // stop refresher if no new statuses let statuses = response.value let newStatuses = statuses.filter { status in !latestStatusIDs.contains(where: { $0 == status.reblog?.id || $0 == status.id }) } diff --git a/Mastodon/Supporting Files/SceneDelegate.swift b/Mastodon/Supporting Files/SceneDelegate.swift index 42c23b433..014c0cedb 100644 --- a/Mastodon/Supporting Files/SceneDelegate.swift +++ b/Mastodon/Supporting Files/SceneDelegate.swift @@ -92,9 +92,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // trigger authenticated user account update AppContext.shared.authenticationService.updateActiveUserAccountPublisher.send() - - // update mutes and blocks and remove related data - AppContext.shared.instanceService.updateMutesAndBlocks() if let shortcutItem = savedShortCutItem { Task { diff --git a/MastodonSDK/Sources/MastodonCore/Service/InstanceService.swift b/MastodonSDK/Sources/MastodonCore/Service/InstanceService.swift index 0d1509af8..fb4335cc3 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/InstanceService.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/InstanceService.swift @@ -121,23 +121,3 @@ extension InstanceService { .eraseToAnyPublisher() } } - -public extension InstanceService { - func updateMutesAndBlocks() { - Task { - for authBox in authenticationService?.mastodonAuthenticationBoxes ?? [] { - do { - try await apiService?.getMutes( - authenticationBox: authBox - ) - - try await apiService?.getBlocked( - authenticationBox: authBox - ) - - } catch { - } - } - } - } -}