Skip to content

Commit bbeed1b

Browse files
committed
enable Remix AI and matomo
1 parent a7c2093 commit bbeed1b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libs/remix-ui/app/src/lib/remix-app/components/modals/managePreferences.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react'
22
import { FormattedMessage } from 'react-intl'
33
import { useDialogDispatchers } from '../../context/provider'
44
import { CustomTooltip } from "@remix-ui/helper"
5-
import { useIntl } from 'react-intl';
5+
import { AppContext } from '../../context/context'
66
declare global {
77
interface Window {
88
_paq: any
@@ -16,7 +16,6 @@ interface ManagePreferencesDialogProps {
1616
const ManagePreferencesSwitcher = (prop: {
1717
setParentState: (state: any) => void
1818
}) => {
19-
const intl = useIntl()
2019
const [remixAISwitch, setRemixAISwitch] = useState(true)
2120
const [matPerfSwitch, setMatPerfSwitch] = useState(true)
2221

@@ -111,6 +110,7 @@ const ManagePreferencesSwitcher = (prop: {
111110

112111
const ManagePreferencesDialog = (props: ManagePreferencesDialogProps) => {
113112
const { modal } = useDialogDispatchers()
113+
let { settings } = useContext(AppContext)
114114
const [visible, setVisible] = useState<boolean>(true)
115115
let switcherState = useRef<Record<string, any>>(null)
116116

@@ -131,7 +131,8 @@ const ManagePreferencesDialog = (props: ManagePreferencesDialogProps) => {
131131
}, [visible])
132132

133133
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
135136
}
136137

137138
return <></>

0 commit comments

Comments
 (0)