updating from settings as well

pull/4306/head
lianahus 1 year ago committed by yann300
parent 9c4229ed8d
commit b98b5258ef
  1. 13
      apps/remix-ide/src/app/tabs/settings-tab.tsx
  2. 8
      libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx

@ -85,6 +85,19 @@ module.exports = class SettingsTab extends ViewPlugin {
updateMatomoAnalyticsChoice(isChecked) {
this.config.set('settings/matomo-analytics', isChecked)
this.useMatomoAnalytics = isChecked
if (!isChecked) {
_paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
// OR revoke cookie consent
_paq.push(['forgetCookieConsentGiven']);
} else {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
// OR user has given consent to store and use cookies
_paq.push(['setCookieConsentGiven']);
}
this.dispatch({
...this
})

@ -57,11 +57,19 @@ const MatomoDialog = (props) => {
const declineModal = async () => {
settings.updateMatomoAnalyticsChoice(false)
_paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
// OR revoke cookie consent
_paq.push(['forgetCookieConsentGiven']);
setVisible(false)
}
const handleModalOkClick = async () => {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
// OR user has given consent to store and use cookies
_paq.push(['setCookieConsentGiven']);
settings.updateMatomoAnalyticsChoice(true)
setVisible(false)
}

Loading…
Cancel
Save