From 01ec605c5135028f1c7d632eb478aa8f525aa35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20V=C3=A9lez?= Date: Fri, 15 Nov 2024 21:33:08 -0400 Subject: [PATCH] REF: Allow reports on dev mode (#7314) Bug reports help in some scenarios (especially with extensions like watchOS app) --- blue_modules/analytics.ts | 34 ++++++++++++++++------------------ screen/settings/About.tsx | 30 +++++++++++++----------------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/blue_modules/analytics.ts b/blue_modules/analytics.ts index 480ac5103..5da0ac7d9 100644 --- a/blue_modules/analytics.ts +++ b/blue_modules/analytics.ts @@ -12,26 +12,24 @@ const BlueApp = BlueAppClass.getInstance(); */ let userHasOptedOut: boolean = false; -if (process.env.NODE_ENV !== 'development') { - (async () => { - const uniqueID = await getUniqueId(); - const doNotTrack = await BlueApp.isDoNotTrackEnabled(); +(async () => { + const uniqueID = await getUniqueId(); + const doNotTrack = await BlueApp.isDoNotTrackEnabled(); - if (doNotTrack) { - // dont start Bugsnag at all - return; - } + if (doNotTrack) { + // dont start Bugsnag at all + return; + } - Bugsnag.start({ - user: { - id: uniqueID, - }, - onError: function (event) { - return !userHasOptedOut; - }, - }); - })(); -} + Bugsnag.start({ + user: { + id: uniqueID, + }, + onError: function (event) { + return !userHasOptedOut; + }, + }); +})(); const A = async (event: string) => {}; diff --git a/screen/settings/About.tsx b/screen/settings/About.tsx index 586b57e7c..c63490ebd 100644 --- a/screen/settings/About.tsx +++ b/screen/settings/About.tsx @@ -207,23 +207,19 @@ const About: React.FC = () => { w, h = {width}, {height} - {process.env.NODE_ENV !== 'development' && ( - <> - Unique ID: {getUniqueIdSync()} - - { - const stringToCopy = 'userId:' + getUniqueIdSync(); - A.logError('copied unique id'); - Clipboard.setString(stringToCopy); - }} - > - {loc.transactions.details_copy} - - - - )} + Unique ID: {getUniqueIdSync()} + + { + const stringToCopy = 'userId:' + getUniqueIdSync(); + A.logError('copied unique id'); + Clipboard.setString(stringToCopy); + }} + > + {loc.transactions.details_copy} + +