1 import { Component } from "inferno";
2 import { I18NextService } from "../../services";
4 export interface IPromptProps {
8 export default class NavigationPrompt extends Component<IPromptProps, any> {
16 this.unblock = this.context.router.history.block(tx => {
17 if (window.confirm(I18NextService.i18n.t("block_leaving") ?? undefined)) {
30 public componentWillMount() {
31 if (this.props.when) {
36 public componentWillReceiveProps(nextProps: IPromptProps) {
38 if (!this.props.when) {
46 public componentWillUnmount() {