Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ImageController to new Observable macro #391

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Mochi Diffusion/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import UserNotifications

@main
struct MochiDiffusionApp: App {
@StateObject private var controller: ImageController
@State private var controller: ImageController
@State private var generator: ImageGenerator
@State private var store: ImageStore
@State private var focusCon: FocusController
Expand All @@ -34,9 +34,11 @@ struct MochiDiffusionApp: App {
}

var body: some Scene {
@Bindable var controller = controller

Window("Mochi Diffusion", id: "main") {
AppView()
.environmentObject(controller)
.environment(controller)
.environment(generator)
.environment(store)
.environment(focusCon)
Expand Down Expand Up @@ -69,7 +71,7 @@ struct MochiDiffusionApp: App {

Settings {
SettingsView()
.environmentObject(controller)
.environment(controller)
.environment(notificationController)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Mochi Diffusion/Main Menu/ImageCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SwiftUI

struct ImageCommands: Commands {
@ObservedObject var controller: ImageController
var controller: ImageController
var generator: ImageGenerator
var store: ImageStore
var focusController: FocusController
Expand Down
Loading
Loading