REF: Allow reports on dev mode (#7314)

Bug reports help in some scenarios (especially with extensions like watchOS app)
This commit is contained in:
Marcos Rodriguez Vélez 2024-11-15 21:33:08 -04:00 committed by GitHub
parent 95ab408605
commit 01ec605c51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 35 deletions

View File

@ -12,26 +12,24 @@ const BlueApp = BlueAppClass.getInstance();
*/ */
let userHasOptedOut: boolean = false; let userHasOptedOut: boolean = false;
if (process.env.NODE_ENV !== 'development') { (async () => {
(async () => { const uniqueID = await getUniqueId();
const uniqueID = await getUniqueId(); const doNotTrack = await BlueApp.isDoNotTrackEnabled();
const doNotTrack = await BlueApp.isDoNotTrackEnabled();
if (doNotTrack) { if (doNotTrack) {
// dont start Bugsnag at all // dont start Bugsnag at all
return; return;
} }
Bugsnag.start({ Bugsnag.start({
user: { user: {
id: uniqueID, id: uniqueID,
}, },
onError: function (event) { onError: function (event) {
return !userHasOptedOut; return !userHasOptedOut;
}, },
}); });
})(); })();
}
const A = async (event: string) => {}; const A = async (event: string) => {};

View File

@ -207,23 +207,19 @@ const About: React.FC = () => {
<BlueTextCentered> <BlueTextCentered>
w, h = {width}, {height} w, h = {width}, {height}
</BlueTextCentered> </BlueTextCentered>
{process.env.NODE_ENV !== 'development' && ( <BlueTextCentered>Unique ID: {getUniqueIdSync()}</BlueTextCentered>
<> <View style={styles.copyToClipboard}>
<BlueTextCentered>Unique ID: {getUniqueIdSync()}</BlueTextCentered> <TouchableOpacity
<View style={styles.copyToClipboard}> accessibilityRole="button"
<TouchableOpacity onPress={() => {
accessibilityRole="button" const stringToCopy = 'userId:' + getUniqueIdSync();
onPress={() => { A.logError('copied unique id');
const stringToCopy = 'userId:' + getUniqueIdSync(); Clipboard.setString(stringToCopy);
A.logError('copied unique id'); }}
Clipboard.setString(stringToCopy); >
}} <Text style={styles.copyToClipboardText}>{loc.transactions.details_copy}</Text>
> </TouchableOpacity>
<Text style={styles.copyToClipboardText}>{loc.transactions.details_copy}</Text> </View>
</TouchableOpacity>
</View>
</>
)}
<BlueSpacing20 /> <BlueSpacing20 />
<BlueSpacing20 /> <BlueSpacing20 />
</ScrollView> </ScrollView>