react-native-pagecall
Advanced tools
Comparing version 2.0.13-nomi3 to 2.0.13-nomi4
@@ -63,7 +63,12 @@ "use strict"; | ||
mountCount += 1; | ||
console.log('PagecallView mounted', mountCount); | ||
if (mountCount > 1) console.error('PagecallView is not supposed to be rendered twice or more at the same time. Please make sure the previous view is unmounted.'); | ||
return () => { | ||
var _NativeModules$Pageca3, _NativeModules$Pageca4; | ||
(_NativeModules$Pageca3 = _reactNative.NativeModules.PagecallViewManager) === null || _NativeModules$Pageca3 === void 0 ? void 0 : (_NativeModules$Pageca4 = _NativeModules$Pageca3.dispose) === null || _NativeModules$Pageca4 === void 0 ? void 0 : _NativeModules$Pageca4.call(_NativeModules$Pageca3); | ||
mountCount -= 1; | ||
console.log('PagecallView unmounted', mountCount); | ||
if (mountCount === 0) { | ||
var _NativeModules$Pageca3, _NativeModules$Pageca4; | ||
console.log('PagecallView is being disposed'); | ||
(_NativeModules$Pageca3 = _reactNative.NativeModules.PagecallViewManager) === null || _NativeModules$Pageca3 === void 0 ? void 0 : (_NativeModules$Pageca4 = _NativeModules$Pageca3.dispose) === null || _NativeModules$Pageca4 === void 0 ? void 0 : _NativeModules$Pageca4.call(_NativeModules$Pageca3); | ||
} | ||
}; | ||
@@ -81,3 +86,3 @@ }, []); | ||
const onNativeEvent = (0, _react.useCallback)(event => { | ||
const eventHandlers = eventHandlersRef.current; | ||
const currentEventHandlers = eventHandlersRef.current; | ||
const data = event.nativeEvent; | ||
@@ -88,4 +93,4 @@ if (!data) return; | ||
{ | ||
var _eventHandlers$onLoad; | ||
(_eventHandlers$onLoad = eventHandlers.onLoad) === null || _eventHandlers$onLoad === void 0 ? void 0 : _eventHandlers$onLoad.call(eventHandlers); | ||
var _currentEventHandlers; | ||
(_currentEventHandlers = currentEventHandlers.onLoad) === null || _currentEventHandlers === void 0 ? void 0 : _currentEventHandlers.call(currentEventHandlers); | ||
return; | ||
@@ -95,4 +100,4 @@ } | ||
{ | ||
var _eventHandlers$onErro; | ||
(_eventHandlers$onErro = eventHandlers.onError) === null || _eventHandlers$onErro === void 0 ? void 0 : _eventHandlers$onErro.call(eventHandlers, new Error(data.message)); | ||
var _currentEventHandlers2; | ||
(_currentEventHandlers2 = currentEventHandlers.onError) === null || _currentEventHandlers2 === void 0 ? void 0 : _currentEventHandlers2.call(currentEventHandlers, new Error(data.message)); | ||
return; | ||
@@ -102,4 +107,4 @@ } | ||
{ | ||
var _eventHandlers$onTerm; | ||
(_eventHandlers$onTerm = eventHandlers.onTerminate) === null || _eventHandlers$onTerm === void 0 ? void 0 : _eventHandlers$onTerm.call(eventHandlers, data.reason); | ||
var _currentEventHandlers3; | ||
(_currentEventHandlers3 = currentEventHandlers.onTerminate) === null || _currentEventHandlers3 === void 0 ? void 0 : _currentEventHandlers3.call(currentEventHandlers, data.reason); | ||
return; | ||
@@ -109,4 +114,4 @@ } | ||
{ | ||
var _eventHandlers$onMess; | ||
(_eventHandlers$onMess = eventHandlers.onMessage) === null || _eventHandlers$onMess === void 0 ? void 0 : _eventHandlers$onMess.call(eventHandlers, data.message); | ||
var _currentEventHandlers4; | ||
(_currentEventHandlers4 = currentEventHandlers.onMessage) === null || _currentEventHandlers4 === void 0 ? void 0 : _currentEventHandlers4.call(currentEventHandlers, data.message); | ||
return; | ||
@@ -116,4 +121,4 @@ } | ||
{ | ||
var _eventHandlers$onEven; | ||
(_eventHandlers$onEven = eventHandlers.onEvent) === null || _eventHandlers$onEven === void 0 ? void 0 : _eventHandlers$onEven.call(eventHandlers, data.payload); | ||
var _currentEventHandlers5; | ||
(_currentEventHandlers5 = currentEventHandlers.onEvent) === null || _currentEventHandlers5 === void 0 ? void 0 : _currentEventHandlers5.call(currentEventHandlers, data.payload); | ||
} | ||
@@ -120,0 +125,0 @@ } |
@@ -56,7 +56,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
mountCount += 1; | ||
console.log('PagecallView mounted', mountCount); | ||
if (mountCount > 1) console.error('PagecallView is not supposed to be rendered twice or more at the same time. Please make sure the previous view is unmounted.'); | ||
return () => { | ||
var _NativeModules$Pageca3, _NativeModules$Pageca4; | ||
(_NativeModules$Pageca3 = NativeModules.PagecallViewManager) === null || _NativeModules$Pageca3 === void 0 ? void 0 : (_NativeModules$Pageca4 = _NativeModules$Pageca3.dispose) === null || _NativeModules$Pageca4 === void 0 ? void 0 : _NativeModules$Pageca4.call(_NativeModules$Pageca3); | ||
mountCount -= 1; | ||
console.log('PagecallView unmounted', mountCount); | ||
if (mountCount === 0) { | ||
var _NativeModules$Pageca3, _NativeModules$Pageca4; | ||
console.log('PagecallView is being disposed'); | ||
(_NativeModules$Pageca3 = NativeModules.PagecallViewManager) === null || _NativeModules$Pageca3 === void 0 ? void 0 : (_NativeModules$Pageca4 = _NativeModules$Pageca3.dispose) === null || _NativeModules$Pageca4 === void 0 ? void 0 : _NativeModules$Pageca4.call(_NativeModules$Pageca3); | ||
} | ||
}; | ||
@@ -74,3 +79,3 @@ }, []); | ||
const onNativeEvent = useCallback(event => { | ||
const eventHandlers = eventHandlersRef.current; | ||
const currentEventHandlers = eventHandlersRef.current; | ||
const data = event.nativeEvent; | ||
@@ -81,4 +86,4 @@ if (!data) return; | ||
{ | ||
var _eventHandlers$onLoad; | ||
(_eventHandlers$onLoad = eventHandlers.onLoad) === null || _eventHandlers$onLoad === void 0 ? void 0 : _eventHandlers$onLoad.call(eventHandlers); | ||
var _currentEventHandlers; | ||
(_currentEventHandlers = currentEventHandlers.onLoad) === null || _currentEventHandlers === void 0 ? void 0 : _currentEventHandlers.call(currentEventHandlers); | ||
return; | ||
@@ -88,4 +93,4 @@ } | ||
{ | ||
var _eventHandlers$onErro; | ||
(_eventHandlers$onErro = eventHandlers.onError) === null || _eventHandlers$onErro === void 0 ? void 0 : _eventHandlers$onErro.call(eventHandlers, new Error(data.message)); | ||
var _currentEventHandlers2; | ||
(_currentEventHandlers2 = currentEventHandlers.onError) === null || _currentEventHandlers2 === void 0 ? void 0 : _currentEventHandlers2.call(currentEventHandlers, new Error(data.message)); | ||
return; | ||
@@ -95,4 +100,4 @@ } | ||
{ | ||
var _eventHandlers$onTerm; | ||
(_eventHandlers$onTerm = eventHandlers.onTerminate) === null || _eventHandlers$onTerm === void 0 ? void 0 : _eventHandlers$onTerm.call(eventHandlers, data.reason); | ||
var _currentEventHandlers3; | ||
(_currentEventHandlers3 = currentEventHandlers.onTerminate) === null || _currentEventHandlers3 === void 0 ? void 0 : _currentEventHandlers3.call(currentEventHandlers, data.reason); | ||
return; | ||
@@ -102,4 +107,4 @@ } | ||
{ | ||
var _eventHandlers$onMess; | ||
(_eventHandlers$onMess = eventHandlers.onMessage) === null || _eventHandlers$onMess === void 0 ? void 0 : _eventHandlers$onMess.call(eventHandlers, data.message); | ||
var _currentEventHandlers4; | ||
(_currentEventHandlers4 = currentEventHandlers.onMessage) === null || _currentEventHandlers4 === void 0 ? void 0 : _currentEventHandlers4.call(currentEventHandlers, data.message); | ||
return; | ||
@@ -109,4 +114,4 @@ } | ||
{ | ||
var _eventHandlers$onEven; | ||
(_eventHandlers$onEven = eventHandlers.onEvent) === null || _eventHandlers$onEven === void 0 ? void 0 : _eventHandlers$onEven.call(eventHandlers, data.payload); | ||
var _currentEventHandlers5; | ||
(_currentEventHandlers5 = currentEventHandlers.onEvent) === null || _currentEventHandlers5 === void 0 ? void 0 : _currentEventHandlers5.call(currentEventHandlers, data.payload); | ||
} | ||
@@ -113,0 +118,0 @@ } |
{ | ||
"name": "react-native-pagecall", | ||
"version": "2.0.13-nomi3", | ||
"version": "2.0.13-nomi4", | ||
"description": "A React Native module that provides a simple WebView component to integrate Pagecall", | ||
@@ -5,0 +5,0 @@ "main": "lib/commonjs/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
96461
721