Skip to content

Commit

Permalink
Use Task in userSettings.objectWillChange.sink
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jan 25, 2025
1 parent 1f750ae commit 2dcb5c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ShowyEdge/swift/IndicatorsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ class IndicatorsController {
self.updateColorByInputSource()
}.store(in: &cancellables)

userSettings.objectWillChange.sink { @MainActor _ in
self.updateWindowFrames()
self.updateColorByInputSource()
userSettings.objectWillChange.sink { _ in
// Use Task to perform processing after the settings are changed.
Task { @MainActor in
self.updateWindowFrames()
self.updateColorByInputSource()
}
}.store(in: &cancellables)

setupWindows()
Expand Down

0 comments on commit 2dcb5c1

Please sign in to comment.