mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-21 23:35:05 +00:00
BUGFIX wrapped usage of window.umami in a check
This commit is contained in:
parent
f793d43254
commit
5b735aaf10
2 changed files with 7 additions and 5 deletions
10
src/App.js
10
src/App.js
|
@ -71,7 +71,7 @@ function trigger_download(name, data){
|
|||
function UmamiLink({ href, name, target, children, ...props }) {
|
||||
const handleClick = useCallback(event => {
|
||||
|
||||
if (name) {
|
||||
if (window.umami && name) {
|
||||
window.umami.trackEvent('A: ' + name) // Log Anker / Link
|
||||
}
|
||||
|
||||
|
@ -291,9 +291,11 @@ function App({ getString, locales, currentLocale, onLanguageChange }) {
|
|||
const frameName = frame.name || 'No-Frame'
|
||||
const hashtagName = hashtag.name || 'No-Hashtag'
|
||||
|
||||
window.umami.trackEvent('F: ' + frameName) // Log Frame
|
||||
window.umami.trackEvent('H: ' + hashtagName) // Log Hashtag
|
||||
window.umami.trackEvent('C: ' + [frameName, hashtagName].join(' | ')) // Log Combined
|
||||
if (window.umami) {
|
||||
window.umami.trackEvent('F: ' + frameName) // Log Frame
|
||||
window.umami.trackEvent('H: ' + hashtagName) // Log Hashtag
|
||||
window.umami.trackEvent('C: ' + [frameName, hashtagName].join(' | ')) // Log Combined
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ function AppLanguageWrapper() {
|
|||
|
||||
useEffect(() => {
|
||||
let systemLocales = navigator.languages
|
||||
if (!!systemLocales || Array.isArray(systemLocales)) {
|
||||
if (window.umami && (!!systemLocales || Array.isArray(systemLocales))) {
|
||||
for (const locale of systemLocales) {
|
||||
window.umami.trackEvent('L: ' + locale) // Log Locale / Languages
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue