Unverified Commit e3c27e92 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #911 from ethereum/matomoTheme

added track of theme changes
parents 9e686b2b 06ab21f9
...@@ -3,6 +3,7 @@ import { EventEmitter } from 'events' ...@@ -3,6 +3,7 @@ import { EventEmitter } from 'events'
import QueryParams from '../../lib/query-params' import QueryParams from '../../lib/query-params'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import yo from 'yo-yo' import yo from 'yo-yo'
const _paq = window._paq = window._paq || []
const themes = [ const themes = [
{ name: 'Dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' }, { name: 'Dark', quality: 'dark', url: 'assets/css/themes/remix-dark_tvx1s2.css' },
...@@ -77,6 +78,7 @@ export class ThemeModule extends Plugin { ...@@ -77,6 +78,7 @@ export class ThemeModule extends Plugin {
if (themeName && !Object.keys(this.themes).includes(themeName)) { if (themeName && !Object.keys(this.themes).includes(themeName)) {
throw new Error(`Theme ${themeName} doesn't exist`) throw new Error(`Theme ${themeName} doesn't exist`)
} }
_paq.push(['trackEvent', 'themeModule', 'switchTo', themeName])
const next = themeName || this.active // Name const next = themeName || this.active // Name
const nextTheme = this.themes[next] // Theme const nextTheme = this.themes[next] // Theme
if (!this.forced) this._deps.config.set('settings/theme', next) if (!this.forced) this._deps.config.set('settings/theme', next)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment