From d49ee5fd2b6ccd33349a4168bec7397aea0489e8 Mon Sep 17 00:00:00 2001 From: phlpsong Date: Sat, 20 Jan 2024 15:21:08 +0800 Subject: [PATCH] fix: disabled environment --- Easydict/NewApp/View/SettingView/Tabs/DisabledAppTab.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Easydict/NewApp/View/SettingView/Tabs/DisabledAppTab.swift b/Easydict/NewApp/View/SettingView/Tabs/DisabledAppTab.swift index 86a161507..b7121c403 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/DisabledAppTab.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/DisabledAppTab.swift @@ -136,13 +136,13 @@ private struct ListToolbar: View { ListButton(systemName: "plus") { disabledAppViewModel.isImporting.toggle() } - .environment(\.isEnabled, true) + .disabled(false) Divider() .padding(.vertical, 1) ListButton(systemName: "minus") { disabledAppViewModel.removeDisabledApp() } - .environment(\.isEnabled, !disabledAppViewModel.selectedAppModels.isEmpty) + .disabled(!disabledAppViewModel.selectedAppModels.isEmpty) Spacer() } .padding(2) @@ -172,7 +172,6 @@ private struct ListButton: View { .font(.system(size: 14, weight: .semibold)) } .buttonStyle(BorderlessButtonStyle()) - .disabled(isEnabled) } }