Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroboron committed Jan 9, 2025
1 parent 6e87f5f commit fae19a7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ final class MaliciousSiteProtectionSettingsViewModel: ObservableObject {
self.manager.isEnabled
},
set: {
self.manager.isEnabled = $0
self.isMaliciousSiteProtectionEnabled = $0
self.updateMaliciousSiteProtection(enabled: $0)
}
)
}
Expand All @@ -57,4 +56,10 @@ final class MaliciousSiteProtectionSettingsViewModel: ObservableObject {
func learnMoreAction() {
urlOpener.open(URL.maliciousSiteProtectionLearnMore)
}

private func updateMaliciousSiteProtection(enabled isEnabled: Bool) {
manager.isEnabled = isEnabled
isMaliciousSiteProtectionEnabled = isEnabled
}

}

0 comments on commit fae19a7

Please sign in to comment.