From ffd53ec56582de46ac2c7931da85227d7d736706 Mon Sep 17 00:00:00 2001 From: tisfeng Date: Tue, 16 Jan 2024 12:45:21 +0800 Subject: [PATCH] fix: do not post update notification if service enabled is not changed --- Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift b/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift index dc7cc88b8..a975f36b8 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift @@ -170,11 +170,13 @@ private struct ServiceItemView: View { get { inner.enabled } set { - inner.enabled = newValue - if newValue { - inner.enabledQuery = newValue + if inner.enabled != newValue { + inner.enabled = newValue + if newValue { + inner.enabledQuery = newValue + } + save() } - save() } }