Remove obsolete code

This commit is contained in:
Nathan Mattes 2023-06-28 09:43:12 +02:00
parent 4107370957
commit 79ba6ed13f
4 changed files with 2 additions and 71 deletions

View File

@ -72,22 +72,6 @@ final class HomeTimelineNavigationBarTitleViewModel {
}
.store(in: &disposeBag)
// context.statusPublishService.latestPublishingComposeViewModel
// .receive(on: DispatchQueue.main)
// .sink { [weak self] composeViewModel in
// guard let self = self else { return }
// guard let composeViewModel = composeViewModel,
// let state = composeViewModel.publishStateMachine.currentState else {
// self.isPublishingPost.value = false
// self.isPublished.value = false
// return
// }
//
// self.isPublishingPost.value = state is ComposeViewModel.PublishState.Publishing || state is ComposeViewModel.PublishState.Fail
// self.isPublished.value = state is ComposeViewModel.PublishState.Finish
// }
// .store(in: &disposeBag)
Publishers.CombineLatest4(
hasNewPosts.eraseToAnyPublisher(),
isOffline.eraseToAnyPublisher(),

View File

@ -214,32 +214,7 @@ extension MainTabBarController {
.store(in: &disposeBag)
// handle post failure
// FIXME: refacotr
// context.statusPublishService
// .latestPublishingComposeViewModel
// .receive(on: DispatchQueue.main)
// .sink { [weak self] composeViewModel in
// guard let self = self else { return }
// guard let composeViewModel = composeViewModel else { return }
// guard let currentState = composeViewModel.publishStateMachine.currentState else { return }
// guard currentState is ComposeViewModel.PublishState.Fail else { return }
//
// let alertController = UIAlertController(title: L10n.Common.Alerts.PublishPostFailure.title, message: L10n.Common.Alerts.PublishPostFailure.message, preferredStyle: .alert)
// let discardAction = UIAlertAction(title: L10n.Common.Controls.Actions.discard, style: .destructive) { [weak self, weak composeViewModel] _ in
// guard let self = self else { return }
// guard let composeViewModel = composeViewModel else { return }
// self.context.statusPublishService.remove(composeViewModel: composeViewModel)
// }
// alertController.addAction(discardAction)
// let retryAction = UIAlertAction(title: L10n.Common.Controls.Actions.tryAgain, style: .default) { [weak composeViewModel] _ in
// guard let composeViewModel = composeViewModel else { return }
// composeViewModel.publishStateMachine.enter(ComposeViewModel.PublishState.Publishing.self)
// }
// alertController.addAction(retryAction)
// self.present(alertController, animated: true, completion: nil)
// }
// .store(in: &disposeBag)
// handle push notification.
// toggle entry when finish fetch latest notification
Publishers.CombineLatest(

View File

@ -23,7 +23,7 @@ public class AppContext: ObservableObject {
public let apiService: APIService
public let authenticationService: AuthenticationService
public let emojiService: EmojiService
// public let statusPublishService = StatusPublishService()
public let publisherService: PublisherService
public let notificationService: NotificationService
public let settingService: SettingService

View File

@ -1,28 +0,0 @@
//
// StatusPublishService.swift
// Mastodon
//
// Created by MainasuK Cirno on 2021-3-26.
//
import Foundation
import Intents
import Combine
import CoreData
import CoreDataStack
import MastodonSDK
import UIKit
public final class StatusPublishService {
var disposeBag = Set<AnyCancellable>()
let workingQueue = DispatchQueue(label: "org.joinmastodon.app.StatusPublishService.working-queue")
// input
// var viewModels = CurrentValueSubject<[ComposeViewModel], Never>([]) // use strong reference to retain the view models
// output
let composeViewModelDidUpdatePublisher = PassthroughSubject<Void, Never>()
// let latestPublishingComposeViewModel = CurrentValueSubject<ComposeViewModel?, Never>(nil)
}