Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function dismissOverlay(componentId) {
try {
await Navigation.dismissOverlay(componentId);
} catch (error) {
// RNN returns a promise rejection if there is no modal with
// this componentId to dismiss. We'll do nothing in this case.
}
}
static disMissOverLayOrModal(componentName) {
if (CommonUtil.isAndroid()) {
Navigation.dismissOverlay(componentName)
.then((result) => {
console.log({result});
}).catch((error) => {
console.log({error});
});
} else {
Navigation.dismissModal(componentName)
.then((result) => {
console.log({result});
}).catch((error) => {
console.log({error});
});
}
}
onClosed = () => {
Navigation.dismissOverlay(this.props.componentId);
};
onPress={() => Navigation.dismissOverlay(this.props.componentId)}
>
onClosed = () => {
Navigation.dismissOverlay(this.props.componentId);
};
const dismissOverlay = (name) => Navigation.dismissOverlay(name);
return async (dispatch, getState) => {
const state = getState();
audioActor().unloadAudio();
if (state.bottomPlayer.playerOpen) {
Navigation.dismissOverlay('bottomPlayer');
}
dispatch({
type: PLAYER_STATUS_UNLOADED,
});
};
}
onCLickOk() {
Navigation.dismissOverlay(this.props.componentId);
}
}
_handleBackPress = () => {
Navigation.dismissOverlay(this.props.componentId);
return true;
};
onClosed = () => {
Navigation.dismissOverlay(this.props.componentId);
};