chore(): sync next with main branch

This commit is contained in:
Liam DeBeasi
2021-05-26 10:14:38 -04:00
committed by GitHub
104 changed files with 12704 additions and 6579 deletions

View File

@ -33,6 +33,8 @@ interface NavManagerProps {
}
export class NavManager extends React.PureComponent<NavManagerProps, NavContextState> {
_isMounted = false;
ionRouterContextValue: IonRouterContextState = {
push: (
pathname: string,
@ -68,15 +70,31 @@ export class NavManager extends React.PureComponent<NavManagerProps, NavContextS
};
if (typeof document !== 'undefined') {
document.addEventListener('ionBackButton', (e: any) => {
e.detail.register(0, (processNextHandler: () => void) => {
this.nativeGoBack();
processNextHandler();
});
});
this.handleHardwareBackButton = this.handleHardwareBackButton.bind(this);
document.addEventListener('ionBackButton', this.handleHardwareBackButton);
}
}
componentDidMount() {
this._isMounted = true;
}
componentWillUnmount() {
if (typeof document !== 'undefined') {
document.removeEventListener('ionBackButton', this.handleHardwareBackButton);
this._isMounted = false;
}
}
handleHardwareBackButton(e: any) {
e.detail.register(0, (processNextHandler: () => void) => {
if (this._isMounted) {
this.nativeGoBack();
processNextHandler();
}
});
}
goBack(route?: string | RouteInfo, animationBuilder?: AnimationBuilder) {
this.props.onNavigateBack(route, animationBuilder);
}