feat: locally store stats so users can see them (no ui yet)

This commit is contained in:
David Ralph
2021-06-30 11:27:54 +01:00
parent 1d44b2792e
commit 2dcaa5270d
28 changed files with 78 additions and 45 deletions

View File

@@ -28,7 +28,7 @@ export default class AdvancedSettings extends React.PureComponent {
});
toast(window.language.toasts.imported);
window.analytics.postEvent('tab', 'Settings imported');
window.stats.postEvent('tab', 'Settings imported');
}
render() {

View File

@@ -10,6 +10,9 @@ export default function ExperimentalSettings() {
<h2>{experimental.title}</h2>
<p>{experimental.warning}</p>
<Checkbox name='animations' text={window.language.modals.main.settings.sections.appearance.animations} element='.other'/>
<h3>Usage Stats</h3>
<p>Allows you to see stats such as how many tabs you have opened, quotes favourited etc. It also sends this data anonymously to our<a className='modalLink' href='https://github.com/mue/umami'>umami</a> instance.</p>
<Checkbox name='stats' text='Enable Usage Stats' element='.other'/>
<h3>{experimental.developer}</h3>
<Checkbox name='debug' text='Debug hotkey (Ctrl + #)' element='.other'/>
<Slider title='Debug timeout' name='debugtimeout' min='0' max='5000' default='0' step='100' display=' miliseconds' element='.other' />

View File

@@ -83,7 +83,7 @@ export default class OrderSettings extends React.PureComponent {
componentDidUpdate() {
localStorage.setItem('order', JSON.stringify(this.state.items));
window.analytics.postEvent('setting', 'Widget order');
window.stats.postEvent('setting', 'Widget order');
EventBus.dispatch('refresh', 'widgets');
}

View File

@@ -104,7 +104,7 @@ export default class ColourSettings extends React.PureComponent {
return newState;
});
window.analytics.postEvent('setting', 'Changed backgroundtype from colour to gradient');
window.stats.postEvent('setting', 'Changed backgroundtype from colour to gradient');
}
currentGradientSettings = () => {