mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Add try/catch logic to recording of analytics events
This commit is contained in:
@@ -26,14 +26,22 @@ function initAwsMobileAnalytics () {
|
||||
|
||||
function recordDynamicCustomEvent (type) {
|
||||
if (process.env.NODE_ENV !== 'production' || !ConfigManager.default.get().amaEnabled) return
|
||||
mobileAnalyticsClient.recordEvent(type)
|
||||
try {
|
||||
mobileAnalyticsClient.recordEvent(type)
|
||||
} catch (analyticsError) {
|
||||
console.error(analyticsError)
|
||||
}
|
||||
}
|
||||
|
||||
function recordStaticCustomEvent () {
|
||||
if (process.env.NODE_ENV !== 'production' || !ConfigManager.default.get().amaEnabled) return
|
||||
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', {
|
||||
uiColorTheme: ConfigManager.default.get().ui.theme
|
||||
})
|
||||
try {
|
||||
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', {
|
||||
uiColorTheme: ConfigManager.default.get().ui.theme
|
||||
})
|
||||
} catch (analyticsError) {
|
||||
console.error(analyticsError)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user