-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.js
More file actions
24 lines (21 loc) · 819 Bytes
/
init.js
File metadata and controls
24 lines (21 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//shims for react-native
import { Buffer } from "buffer";
global.Buffer = Buffer;
import "react-native-get-random-values";
import "react-native-url-polyfill/auto";
//import './electrumSupport'
import { NativeModules } from "react-native";
// In dev mode, reload the app on unhandled promise rejections
global.Promise = require("promise");
require("promise/lib/rejection-tracking").enable({
allRejections: true,
onUnhandled: (id, error) => {
console.error("Restarting for: Unhandled Rejection:", id, error);
if (NativeModules.DevSettings) NativeModules.DevSettings.reload();
},
});
// In dev mode, reload the app on error
ErrorUtils.setGlobalHandler((error, isFatal) => {
console.error("Restarting for error:", error, isFatal);
if (NativeModules.DevSettings) NativeModules.DevSettings.reload();
});