Skip to content

Commit

Permalink
editor: sync settings across scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
bummoblizard committed Jun 9, 2024
1 parent 199b1b2 commit 6a1d09b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CodeApp/Containers/MainScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private struct MainView: View {
@Environment(\.colorScheme) var colorScheme: ColorScheme

@AppStorage("changelog.lastread") var changeLogLastReadVersion = "0.0"
@AppStorage("runeStoneEditorEnabled") var runeStoneEditorEnabled: Bool = false

@SceneStorage("sidebar.visible") var isSideBarVisible: Bool = DefaultUIState.SIDEBAR_VISIBLE
@SceneStorage("panel.height") var panelHeight: Double = DefaultUIState.PANEL_HEIGHT
Expand Down Expand Up @@ -228,6 +229,9 @@ private struct MainView: View {
.onChange(of: colorScheme) { newValue in
App.updateView()
}
.onChange(of: runeStoneEditorEnabled) { _ in
App.setUpEditorInstance()
}
.hiddenScrollableContentBackground()
.onAppear {
let appVersion =
Expand Down
1 change: 0 additions & 1 deletion CodeApp/Views/TopBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ struct TopBar: View {
Section {
Button(action: {
runeStoneEditorEnabled.toggle()
App.setUpEditorInstance()
}) {
Label(
runeStoneEditorEnabled
Expand Down

0 comments on commit 6a1d09b

Please sign in to comment.