Skip to content

Commit

Permalink
perf: improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Jan 28, 2024
1 parent 90bea4e commit 8ae30df
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Easydict/NewApp/View/SettingView/Tabs/AboutTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,16 @@ struct AboutTab: View {
}

class CheckUpdaterViewModel: ObservableObject {
@Published var autoChecksForUpdates: Bool = false {
private let updater = GlobalContext.shared.updaterController.updater

@Published var autoChecksForUpdates = true {
didSet {
GlobalContext
.shared
.updaterController
.updater
.automaticallyChecksForUpdates = autoChecksForUpdates
updater.automaticallyChecksForUpdates = autoChecksForUpdates
}
}

init() {
GlobalContext
.shared
.updaterController
.updater
updater
.publisher(for: \.automaticallyChecksForUpdates)
.assign(to: &$autoChecksForUpdates)
}
Expand Down

0 comments on commit 8ae30df

Please sign in to comment.