mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 12:06:21 +01:00
FIX: eventemitter warning iOS
This commit is contained in:
parent
fe6dd5016c
commit
84ed7e5ac3
2 changed files with 11 additions and 7 deletions
14
App.js
14
App.js
|
@ -39,7 +39,7 @@ import Privacy from './blue_modules/Privacy';
|
|||
const A = require('./blue_modules/analytics');
|
||||
const currency = require('./blue_modules/currency');
|
||||
|
||||
const eventEmitter = new NativeEventEmitter(NativeModules.EventEmitter);
|
||||
const eventEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(NativeModules.EventEmitter) : undefined;
|
||||
const { EventEmitter } = NativeModules;
|
||||
|
||||
const ClipboardContentType = Object.freeze({
|
||||
|
@ -113,9 +113,9 @@ const App = () => {
|
|||
return () => {
|
||||
Linking.removeEventListener('url', handleOpenURL);
|
||||
AppState.removeEventListener('change', handleAppStateChange);
|
||||
eventEmitter.removeAllListeners('onNotificationReceived');
|
||||
eventEmitter.removeAllListeners('openSettings');
|
||||
eventEmitter.removeAllListeners('onUserActivityOpen');
|
||||
eventEmitter?.removeAllListeners('onNotificationReceived');
|
||||
eventEmitter?.removeAllListeners('openSettings');
|
||||
eventEmitter?.removeAllListeners('onUserActivityOpen');
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
@ -144,9 +144,9 @@ const App = () => {
|
|||
When a notification on iOS is shown while the app is on foreground;
|
||||
On willPresent on AppDelegate.m
|
||||
*/
|
||||
eventEmitter.addListener('onNotificationReceived', onNotificationReceived);
|
||||
eventEmitter.addListener('openSettings', openSettings);
|
||||
eventEmitter.addListener('onUserActivityOpen', onUserActivityOpen);
|
||||
eventEmitter?.addListener('onNotificationReceived', onNotificationReceived);
|
||||
eventEmitter?.addListener('openSettings', openSettings);
|
||||
eventEmitter?.addListener('onUserActivityOpen', onUserActivityOpen);
|
||||
};
|
||||
|
||||
const popInitialAction = async data => {
|
||||
|
|
|
@ -22,6 +22,10 @@ RCT_EXPORT_MODULE();
|
|||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (void)removeListeners:(double)count {
|
||||
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
sharedInstance = [super init];
|
||||
return sharedInstance;
|
||||
|
|
Loading…
Add table
Reference in a new issue