mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-21 22:42:21 +01:00
OPS: analytics fix
This commit is contained in:
parent
aebbc11fe9
commit
deea3a087a
8 changed files with 15 additions and 7 deletions
2
App.js
2
App.js
|
@ -13,6 +13,7 @@ import { Chain } from './models/bitcoinUnits';
|
||||||
import QuickActions from 'react-native-quick-actions';
|
import QuickActions from 'react-native-quick-actions';
|
||||||
import * as Sentry from '@sentry/react-native';
|
import * as Sentry from '@sentry/react-native';
|
||||||
import OnAppLaunch from './class/onAppLaunch';
|
import OnAppLaunch from './class/onAppLaunch';
|
||||||
|
const A = require('./analytics');
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'development') {
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
|
@ -110,6 +111,7 @@ export default class App extends React.Component {
|
||||||
_handleAppStateChange = async nextAppState => {
|
_handleAppStateChange = async nextAppState => {
|
||||||
if (BlueApp.getWallets().length > 0) {
|
if (BlueApp.getWallets().length > 0) {
|
||||||
if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
|
if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
|
||||||
|
A(A.ENUM.APP_UNSUSPENDED);
|
||||||
const clipboard = await Clipboard.getString();
|
const clipboard = await Clipboard.getString();
|
||||||
const isAddressFromStoredWallet = BlueApp.getWallets().some(wallet =>
|
const isAddressFromStoredWallet = BlueApp.getWallets().some(wallet =>
|
||||||
wallet.chain === Chain.ONCHAIN ? wallet.weOwnAddress(clipboard) : wallet.isInvoiceGeneratedByWallet(clipboard),
|
wallet.chain === Chain.ONCHAIN ? wallet.weOwnAddress(clipboard) : wallet.isInvoiceGeneratedByWallet(clipboard),
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/* eslint react/prop-types: 0 */
|
/* eslint react/prop-types: 0 */
|
||||||
/** @type {AppStorage} */
|
|
||||||
import React, { Component, useEffect, useState } from 'react';
|
import React, { Component, useEffect, useState } from 'react';
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import amplitude from 'amplitude-js';
|
import amplitude from 'amplitude-js';
|
||||||
import Analytics from 'appcenter-analytics';
|
import Analytics from 'appcenter-analytics';
|
||||||
|
import { getVersion } from 'react-native-device-info';
|
||||||
|
import { Platform } from 'react-native';
|
||||||
|
|
||||||
amplitude.getInstance().init('8b7cf19e8eea3cdcf16340f5fbf16330', null, {
|
amplitude.getInstance().init('8b7cf19e8eea3cdcf16340f5fbf16330', null, {
|
||||||
useNativeDeviceInfo: true,
|
useNativeDeviceInfo: true,
|
||||||
|
platform: Platform.OS,
|
||||||
});
|
});
|
||||||
|
amplitude.getInstance().setVersionName(getVersion());
|
||||||
|
|
||||||
let A = async event => {
|
let A = async event => {
|
||||||
amplitude.getInstance().logEvent(event, {});
|
amplitude.getInstance().logEvent(event, {});
|
||||||
|
@ -17,8 +21,10 @@ let A = async event => {
|
||||||
A.ENUM = {
|
A.ENUM = {
|
||||||
INIT: 'INIT',
|
INIT: 'INIT',
|
||||||
GOT_NONZERO_BALANCE: 'GOT_NONZERO_BALANCE',
|
GOT_NONZERO_BALANCE: 'GOT_NONZERO_BALANCE',
|
||||||
|
GOT_ZERO_BALANCE: 'GOT_ZERO_BALANCE',
|
||||||
CREATED_WALLET: 'CREATED_WALLET',
|
CREATED_WALLET: 'CREATED_WALLET',
|
||||||
CREATED_LIGHTNING_WALLET: 'CREATED_LIGHTNING_WALLET',
|
CREATED_LIGHTNING_WALLET: 'CREATED_LIGHTNING_WALLET',
|
||||||
|
APP_UNSUSPENDED: 'APP_UNSUSPENDED',
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = A;
|
module.exports = A;
|
||||||
|
|
|
@ -455,7 +455,7 @@ export class AppStorage {
|
||||||
getBalance() {
|
getBalance() {
|
||||||
let finalBalance = 0;
|
let finalBalance = 0;
|
||||||
for (let wal of this.wallets) {
|
for (let wal of this.wallets) {
|
||||||
finalBalance += wal.balance;
|
finalBalance += wal.getBalance();
|
||||||
}
|
}
|
||||||
return finalBalance;
|
return finalBalance;
|
||||||
}
|
}
|
||||||
|
|
1
index.js
1
index.js
|
@ -9,7 +9,6 @@ import App from './App';
|
||||||
import LottieView from 'lottie-react-native';
|
import LottieView from 'lottie-react-native';
|
||||||
import UnlockWith from './UnlockWith.js';
|
import UnlockWith from './UnlockWith.js';
|
||||||
|
|
||||||
/** @type {AppStorage} */
|
|
||||||
const A = require('./analytics');
|
const A = require('./analytics');
|
||||||
|
|
||||||
if (!Error.captureStackTrace) {
|
if (!Error.captureStackTrace) {
|
||||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -1923,9 +1923,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"amplitude-js": {
|
"amplitude-js": {
|
||||||
"version": "5.6.0",
|
"version": "5.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-5.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-5.7.0.tgz",
|
||||||
"integrity": "sha512-XGaM0sTvMOrVYqfHhkKEikjQ/SzhEGbupxYopcrzEpEuNLenSOIBMyB0JycBcFI1hTWR4rGJ2TDRqIeRMmUZvg==",
|
"integrity": "sha512-nKE5oJhfuGTxUlJje4XJ7hpRmCTkM1G4sKRvk9vFxo/SsgHZ2qofd9a5Bvk/OKO2N4P9RMyLRa0byJ9j6NIAeg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@amplitude/ua-parser-js": "0.7.20",
|
"@amplitude/ua-parser-js": "0.7.20",
|
||||||
"blueimp-md5": "^2.10.0",
|
"blueimp-md5": "^2.10.0",
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
"@react-native-community/slider": "2.0.0-rc.1",
|
"@react-native-community/slider": "2.0.0-rc.1",
|
||||||
"@remobile/react-native-qrcode-local-image": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git",
|
"@remobile/react-native-qrcode-local-image": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git",
|
||||||
"@sentry/react-native": "1.0.9",
|
"@sentry/react-native": "1.0.9",
|
||||||
"amplitude-js": "5.6.0",
|
"amplitude-js": "5.7.0",
|
||||||
"appcenter": "2.6.0",
|
"appcenter": "2.6.0",
|
||||||
"appcenter-analytics": "2.6.0",
|
"appcenter-analytics": "2.6.0",
|
||||||
"appcenter-crashes": "2.6.0",
|
"appcenter-crashes": "2.6.0",
|
||||||
|
|
|
@ -111,6 +111,8 @@ export default class WalletsList extends Component {
|
||||||
console.log('wallets/list redrawScreen()');
|
console.log('wallets/list redrawScreen()');
|
||||||
if (BlueApp.getBalance() !== 0) {
|
if (BlueApp.getBalance() !== 0) {
|
||||||
A(A.ENUM.GOT_NONZERO_BALANCE);
|
A(A.ENUM.GOT_NONZERO_BALANCE);
|
||||||
|
} else {
|
||||||
|
A(A.ENUM.GOT_ZERO_BALANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Add table
Reference in a new issue