chore: update events

This commit is contained in:
David Ralph
2021-06-21 23:03:47 +01:00
parent 7990286e9a
commit d7784e7414
24 changed files with 44 additions and 35 deletions

View File

@@ -19,7 +19,7 @@ export default class Favourite extends React.PureComponent {
this.setState({
favourited: <StarIcon2 onClick={this.favourite} className='topicons' />
});
window.analytics.postEvent('featureUpdate', 'Feature background favourite used');
window.analytics.postEvent('feature', 'Background favourite');
} else {
const url = document.getElementById('backgroundImage').style.backgroundImage.replace('url("', '').replace('")', '');
@@ -38,7 +38,7 @@ export default class Favourite extends React.PureComponent {
this.setState({
favourited: <StarIcon onClick={this.favourite} className='topicons' />
});
window.analytics.postEvent('featureUpdate', 'Feature background unfavourite used');
window.analytics.postEvent('feature', 'Background unfavourite');
}
}

View File

@@ -44,14 +44,14 @@ export default class Maximise extends React.PureComponent {
});
this.setAttribute(0, 100);
window.analytics.postEvent('featureUpdate', 'Feature background maximise used');
window.analytics.postEvent('feature', 'Background maximise');
} else {
this.setState({
hidden: false
});
this.setAttribute(localStorage.getItem('blur'), localStorage.getItem('brightness'), true);
window.analytics.postEvent('featureUpdate', 'Feature background unmaximise used');
window.analytics.postEvent('feature', 'Background unmaximise');
}
}

View File

@@ -18,7 +18,7 @@ const downloadImage = async (info) => {
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.analytics.postEvent('featureUpdate', 'Feature background download used');
window.analytics.postEvent('feature', 'Background download');
};
export default function PhotoInformation(props) {

View File

@@ -25,7 +25,7 @@ export default class Notes extends React.PureComponent {
};
pin() {
window.analytics.postEvent('featureUpdate', 'Feature notes pin used');
window.analytics.postEvent('feature', 'Notes pin');
document.getElementById('noteContainer').classList.toggle('visibilityshow');
if (localStorage.getItem('notesPinned') === 'true') {
@@ -36,7 +36,7 @@ export default class Notes extends React.PureComponent {
}
copy() {
window.analytics.postEvent('featureUpdate', 'Feature notes copy used');
window.analytics.postEvent('feature', 'Notes copied');
// this.state.notes doesnt work for some reason
navigator.clipboard.writeText(localStorage.getItem('notes'));
toast(window.language.toasts.notes);

View File

@@ -32,7 +32,7 @@ export default class QuickLinks extends React.PureComponent {
items: data
});
window.analytics.postEvent('featureUpdate', 'Feature delete quicklink used');
window.analytics.postEvent('feature', 'Quicklink delete');
}
addLink = () => {
@@ -75,7 +75,7 @@ export default class QuickLinks extends React.PureComponent {
url: ''
});
window.analytics.postEvent('featureUpdate', 'Feature add quicklink used');
window.analytics.postEvent('feature', 'Quicklink add');
this.toggleAdd();
}

View File

@@ -150,13 +150,13 @@ export default class Quote extends React.PureComponent {
}
copyQuote = () => {
window.analytics.postEvent('featureUpdate', 'Feature quote copy used');
window.analytics.postEvent('feature', 'Quote copied');
navigator.clipboard.writeText(`${this.state.quote} - ${this.state.author}`);
toast(window.language.toasts.quote);
}
tweetQuote = () => {
window.analytics.postEvent('featureUpdate', 'Feature quote tweet used');
window.analytics.postEvent('feature', 'Quote tweet');
window.open(`https://twitter.com/intent/tweet?text=${this.state.quote} - ${this.state.author} on @getmue`, '_blank').focus();
}
@@ -173,7 +173,7 @@ export default class Quote extends React.PureComponent {
});
}
window.analytics.postEvent('featureUpdate', 'Feature quote favourite used');
window.analytics.postEvent('feature', 'Quote favourite');
}
init() {

View File

@@ -44,7 +44,7 @@ export default class Search extends React.PureComponent {
}
setTimeout(() => {
window.analytics.postEvent('featureUpdate', 'Feature voice search used');
window.analytics.postEvent('feature', 'Voice search');
window.location.href = this.state.url + `?${this.state.query}=` + searchText.value;
}, 1000);
};
@@ -59,7 +59,7 @@ export default class Search extends React.PureComponent {
value = document.getElementById('searchtext').value || 'mue fast';
}
window.analytics.postEvent('featureUpdate', 'Feature search used');
window.analytics.postEvent('feature', 'Search');
window.location.href = this.state.url + `?${this.state.query}=` + value;
}