From 14fd5832f5e67e79c5335252fc290ce21e0cf906 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 8 Aug 2020 09:49:26 +0300 Subject: [PATCH] Error boundary: simplify page. --- src/components/ErrorBoundary.tsx | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 2811797..b7993b7 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -3,10 +3,7 @@ import * as React from "react"; -import { store, persistor } from "../store"; -import { resetKey } from "../store/actions"; - -import { EncryptionPasswordError, IntegrityError } from "etebase"; +import { IntegrityError } from "etebase"; import PrettyError from "../widgets/PrettyError"; interface PropsType { @@ -24,28 +21,13 @@ class ErrorBoundary extends React.Component { } public componentDidCatch(error: Error, _info: any) { - if (error instanceof EncryptionPasswordError) { - store.dispatch(resetKey()); - } else if (error instanceof IntegrityError) { - persistor.purge(); - } - this.setState({ error }); } public render() { const { error } = this.state; if (error) { - if (error instanceof EncryptionPasswordError) { - return ( -
-

Wrong Encryption Password

-

- It looks like you've entered the wrong encryption password, please refresh the page and try again. -

-
- ); - } else if (error instanceof IntegrityError) { + if (error instanceof IntegrityError) { return (

Integrity Error