diff --git a/src/store/setting.ts b/src/store/setting.ts index e2ba4912..406088c1 100644 --- a/src/store/setting.ts +++ b/src/store/setting.ts @@ -264,7 +264,8 @@ export const settingStore = createPartialStore({ acceptRetrieveTelemetry: acceptRetrieveTelemetry == "Accepted", }); */ - if (acceptRetrieveTelemetry !== state.acceptRetrieveTelemetry) { + const currentAcceptRetrieveTelemetry = state.acceptRetrieveTelemetry; + if (acceptRetrieveTelemetry !== currentAcceptRetrieveTelemetry) { void useAnalytics().trackEvent("aisp_accept_retrieve_telemetry_update", { acceptRetrieveTelemetry: acceptRetrieveTelemetry == "Accepted", }); @@ -288,7 +289,8 @@ export const settingStore = createPartialStore({ acceptTerms: acceptTerms == "Accepted", }); */ - if (acceptTerms !== state.acceptTerms) { + const currentAcceptTerms = state.acceptTerms; + if (acceptTerms !== currentAcceptTerms) { void useAnalytics().trackEvent("aisp_accept_terms_update", { acceptTerms: acceptTerms == "Accepted", });