2021-08-20 18:26:46 +02:00
|
|
|
import { getUniqueId } from 'react-native-device-info';
|
|
|
|
import Bugsnag from '@bugsnag/react-native';
|
2021-05-07 17:55:17 +02:00
|
|
|
const BlueApp = require('../BlueApp');
|
2019-01-10 16:04:16 +01:00
|
|
|
|
2021-08-20 18:26:46 +02:00
|
|
|
let userHasOptedOut = false;
|
|
|
|
|
2021-05-18 13:54:18 +02:00
|
|
|
if (process.env.NODE_ENV !== 'development') {
|
2023-10-20 16:27:26 +02:00
|
|
|
getUniqueId().then(uniqueID => {
|
|
|
|
Bugsnag.start({
|
|
|
|
collectUserIp: false,
|
|
|
|
user: {
|
|
|
|
id: uniqueID,
|
|
|
|
},
|
|
|
|
onError: function (event) {
|
|
|
|
return !userHasOptedOut;
|
|
|
|
},
|
|
|
|
});
|
2021-08-20 18:26:46 +02:00
|
|
|
});
|
2021-05-18 13:54:18 +02:00
|
|
|
}
|
|
|
|
|
2021-05-07 17:55:17 +02:00
|
|
|
BlueApp.isDoNotTrackEnabled().then(value => {
|
2021-08-20 18:26:46 +02:00
|
|
|
if (value) userHasOptedOut = true;
|
2021-05-07 17:55:17 +02:00
|
|
|
});
|
2019-01-10 16:04:16 +01:00
|
|
|
|
2021-08-12 15:09:32 +02:00
|
|
|
const A = async event => {};
|
2019-01-10 16:04:16 +01:00
|
|
|
|
|
|
|
A.ENUM = {
|
|
|
|
INIT: 'INIT',
|
|
|
|
GOT_NONZERO_BALANCE: 'GOT_NONZERO_BALANCE',
|
2019-11-29 00:16:04 +01:00
|
|
|
GOT_ZERO_BALANCE: 'GOT_ZERO_BALANCE',
|
2019-01-10 16:04:16 +01:00
|
|
|
CREATED_WALLET: 'CREATED_WALLET',
|
|
|
|
CREATED_LIGHTNING_WALLET: 'CREATED_LIGHTNING_WALLET',
|
2019-11-29 00:16:04 +01:00
|
|
|
APP_UNSUSPENDED: 'APP_UNSUSPENDED',
|
2020-03-26 18:26:13 +01:00
|
|
|
NAVIGATED_TO_WALLETS_HODLHODL: 'NAVIGATED_TO_WALLETS_HODLHODL',
|
2019-01-10 16:04:16 +01:00
|
|
|
};
|
|
|
|
|
2021-05-07 17:55:17 +02:00
|
|
|
A.setOptOut = value => {
|
2021-08-20 18:26:46 +02:00
|
|
|
if (value) userHasOptedOut = true;
|
2021-05-07 17:55:17 +02:00
|
|
|
};
|
|
|
|
|
2021-09-13 15:08:49 +02:00
|
|
|
A.logError = errorString => {
|
|
|
|
console.error(errorString);
|
|
|
|
Bugsnag.notify(new Error(String(errorString)));
|
|
|
|
};
|
|
|
|
|
2019-01-10 16:04:16 +01:00
|
|
|
module.exports = A;
|