1 import { Component } from "inferno";
2 import { i18n } from "../../../shared/i18next";
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(i18n.t("block_leaving"))) {
30 public componentWillMount() {
31 if (this.props.when) {
36 public componentWillReceiveProps(nextProps: IPromptProps) {
38 if (!this.props.when) {
46 public componentWillUnmount() {