Refactor ViewModel
This commit is contained in:
@@ -7,7 +7,7 @@ import SwiftUI
|
||||
public struct OverviewView: View {
|
||||
@EnvironmentObject private var environments: ExtensionEnvironments
|
||||
@EnvironmentObject private var profile: ExtensionProfile
|
||||
@StateObject private var coordinator = OverviewCoordinator()
|
||||
@StateObject private var coordinator = OverviewViewModel()
|
||||
@StateObject private var configuration = DashboardCardConfiguration()
|
||||
|
||||
@Binding private var profileList: [ProfilePreview]
|
||||
|
||||
+1
-4
@@ -4,12 +4,9 @@ import Library
|
||||
import SwiftUI
|
||||
|
||||
@MainActor
|
||||
public final class OverviewCoordinator: ObservableObject {
|
||||
@Published public var alert: Alert?
|
||||
public final class OverviewViewModel: BaseViewModel {
|
||||
@Published public var reasserting = false
|
||||
|
||||
public init() {}
|
||||
|
||||
public func switchProfile(_ profileID: Int64, profile: ExtensionProfile, environments: ExtensionEnvironments) async {
|
||||
await SharedPreferences.selectedProfileID.set(profileID)
|
||||
environments.selectedProfileUpdate.send()
|
||||
Reference in New Issue
Block a user