mirror of
https://github.com/mue/mue.git
synced 2026-07-14 20:43:54 +02:00
feat: rewrite stats backend
This commit is contained in:
@@ -18,7 +18,7 @@ const Tabs = (props) => {
|
||||
|
||||
const onClick = (tab, name) => {
|
||||
if (name !== currentName) {
|
||||
variables.stats.postEvent('tab', `Opened ${name}`);
|
||||
variables.stats.postEvent('tab', ${name}, 'opened');
|
||||
}
|
||||
setCurrentTab(tab);
|
||||
setCurrentName(name);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Tooltip, Button } from 'components/Elements';
|
||||
|
||||
function ResetModal({ modalClose }) {
|
||||
const reset = () => {
|
||||
variables.stats.postEvent('setting', 'Reset');
|
||||
variables.stats.postEvent('setting', 'reset');
|
||||
setDefaultSettings('reset');
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ const Checkbox = (props) => {
|
||||
props.onChange(value);
|
||||
}
|
||||
|
||||
variables.stats.postEvent('setting', `${props.name} ${value ? 'enabled' : 'disabled'}`);
|
||||
variables.stats.postEvent('setting', props.name, value ? 'enabled' : 'disabled');
|
||||
|
||||
if (props.element) {
|
||||
if (!document.querySelector(props.element)) {
|
||||
|
||||
@@ -29,7 +29,11 @@ function Radio(props) {
|
||||
props.onChange(value);
|
||||
}
|
||||
|
||||
variables.stats.postEvent('setting', `${props.name} from ${value} to ${value}`);
|
||||
if (props.name !== 'language') {
|
||||
variables.stats.postEvent('setting', props.name, `${value}-${value}`);
|
||||
} else {
|
||||
variables.stats.postEvent('language', props.name, `${value}-${value}`);
|
||||
}
|
||||
|
||||
if (props.element) {
|
||||
if (!document.querySelector(props.element)) {
|
||||
|
||||
@@ -22,7 +22,7 @@ function Header(props) {
|
||||
|
||||
variables.stats.postEvent(
|
||||
'setting',
|
||||
`${props.name} ${setting === true ? 'enabled' : 'disabled'}`,
|
||||
props.setting, setting === true ? 'enabled' : 'disabled',
|
||||
);
|
||||
|
||||
EventBus.emit('toggle', props.setting);
|
||||
|
||||
@@ -31,7 +31,7 @@ const Controls = (props) => {
|
||||
|
||||
variables.stats.postEvent(
|
||||
'setting',
|
||||
`${props.name} ${setting === true ? 'enabled' : 'disabled'}`,
|
||||
props.name, setting === true ? 'enabled' : 'disabled',
|
||||
);
|
||||
|
||||
EventBus.emit('toggle', props.setting);
|
||||
|
||||
Reference in New Issue
Block a user