2021-09-15 14:18:19 +02:00
|
|
|
//
|
|
|
|
// WelcomeViewModel.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by Cirno MainasuK on 2021-9-15.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import Combine
|
2022-10-08 07:43:06 +02:00
|
|
|
import MastodonCore
|
2021-09-15 14:18:19 +02:00
|
|
|
|
|
|
|
final class WelcomeViewModel {
|
|
|
|
|
|
|
|
var disposeBag = Set<AnyCancellable>()
|
|
|
|
|
|
|
|
// input
|
|
|
|
let context: AppContext
|
|
|
|
|
|
|
|
// output
|
2022-10-09 14:07:57 +02:00
|
|
|
@Published var needsShowDismissEntry = false
|
2021-09-15 14:18:19 +02:00
|
|
|
|
|
|
|
init(context: AppContext) {
|
|
|
|
self.context = context
|
|
|
|
|
2022-10-09 14:07:57 +02:00
|
|
|
context.authenticationService.$mastodonAuthenticationBoxes
|
2021-09-15 14:18:19 +02:00
|
|
|
.map { !$0.isEmpty }
|
2022-10-09 14:07:57 +02:00
|
|
|
.assign(to: &$needsShowDismissEntry)
|
2021-09-15 14:18:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|