From d84424202dca22fff22cb1d304286f627642187b Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 31 Aug 2022 00:20:35 -0300
Subject: p2p tx rendering

---
 packages/taler-wallet-webextension/src/stories.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/stories.tsx')

diff --git a/packages/taler-wallet-webextension/src/stories.tsx b/packages/taler-wallet-webextension/src/stories.tsx
index a032222a0..09261d6f7 100644
--- a/packages/taler-wallet-webextension/src/stories.tsx
+++ b/packages/taler-wallet-webextension/src/stories.tsx
@@ -181,10 +181,11 @@ function getContentForExample(item: ExampleItem | undefined): () => VNode {
     item.component,
     item.name,
   );
-  if (!example)
+  if (!example) {
     return function ExampleNotFoundMessage() {
       return <div>example not found</div>;
     };
+  }
   return () => example.render(example.render.args);
 }
 
@@ -314,7 +315,9 @@ function ErrorReport({
   children: ComponentChild;
   selected: ExampleItem | undefined;
 }): VNode {
-  const [error] = useErrorBoundary();
+  const [error, resetError] = useErrorBoundary();
+  //if there is an error, reset when unloading this component
+  useEffect(() => (error ? resetError : undefined));
   if (error) {
     return (
       <div>
-- 
cgit v1.2.3

