Skip to content

Commit

Permalink
Change the enableAllLibraries to use the binding extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
JPKribs committed Nov 27, 2024
1 parent 541da28 commit 51d7219
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ struct ServerUserAccessView: View {
@ViewBuilder
var accessView: some View {
Section(L10n.access) {
Toggle(L10n.enableAllLibraries, isOn: Binding(
get: { tempPolicy.enableAllFolders ?? false },
set: { tempPolicy.enableAllFolders = $0 }
))
Toggle(
L10n.enableAllLibraries,
isOn: $tempPolicy.enableAllFolders.coalesce(false)
)
}

if !(tempPolicy.enableAllFolders ?? false) {
Expand Down Expand Up @@ -134,10 +134,10 @@ struct ServerUserAccessView: View {
@ViewBuilder
var deletionView: some View {
Section(L10n.deletion) {
Toggle(L10n.enableAllLibraries, isOn: Binding(
get: { tempPolicy.enableContentDeletion ?? false },
set: { tempPolicy.enableContentDeletion = $0 }
))
Toggle(
L10n.enableAllLibraries,
isOn: $tempPolicy.enableContentDeletion.coalesce(false)
)
}

if !(tempPolicy.enableContentDeletion ?? false) {
Expand Down

0 comments on commit 51d7219

Please sign in to comment.