@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react'
2
2
import { FormattedMessage } from 'react-intl'
3
3
import { useDialogDispatchers } from '../../context/provider'
4
4
import { CustomTooltip } from "@remix-ui/helper"
5
- import { useIntl } from 'react-intl' ;
5
+ import { AppContext } from '../../context/context'
6
6
declare global {
7
7
interface Window {
8
8
_paq : any
@@ -16,7 +16,6 @@ interface ManagePreferencesDialogProps {
16
16
const ManagePreferencesSwitcher = ( prop : {
17
17
setParentState : ( state : any ) => void
18
18
} ) => {
19
- const intl = useIntl ( )
20
19
const [ remixAISwitch , setRemixAISwitch ] = useState ( true )
21
20
const [ matPerfSwitch , setMatPerfSwitch ] = useState ( true )
22
21
@@ -111,6 +110,7 @@ const ManagePreferencesSwitcher = (prop: {
111
110
112
111
const ManagePreferencesDialog = ( props : ManagePreferencesDialogProps ) => {
113
112
const { modal } = useDialogDispatchers ( )
113
+ let { settings } = useContext ( AppContext )
114
114
const [ visible , setVisible ] = useState < boolean > ( true )
115
115
let switcherState = useRef < Record < string , any > > ( null )
116
116
@@ -131,7 +131,8 @@ const ManagePreferencesDialog = (props: ManagePreferencesDialogProps) => {
131
131
} , [ visible ] )
132
132
133
133
const savePreferences = async ( ) => {
134
- console . log ( 'switcherState--->' , switcherState . current )
134
+ settings . updateMatomoAnalyticsChoice ( true ) // Always true for matomo Anonymous analytics
135
+ settings . updateCopilotChoice ( switcherState . current . remixAISwitch ) // Enable/Disable RemixAI copilot
135
136
}
136
137
137
138
return < > </ >
0 commit comments