diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index a37ca93..6b224a7 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -1,5 +1,8 @@ import * as React from 'react'; +import { persistor } from '../store'; + +import { IntegrityError } from '../api/EteSync'; import PrettyError from '../widgets/PrettyError'; class ErrorBoundary extends React.Component { @@ -13,11 +16,33 @@ class ErrorBoundary extends React.Component { } componentDidCatch(error: Error, info: any) { + if (error instanceof IntegrityError) { + persistor.purge(); + } + this.setState({ error }); } render() { - if (this.state.error) { + const { error } = this.state; + if (error && error instanceof IntegrityError) { + return ( +
+ This probably means you put in the wrong encryption password. +
++ Please log out from the menu, refresh the page and try again. +
++ {error.message} ++