From 038dcbc9b7378552bd5b0548fe373dbd2867c971 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 29 Apr 2022 13:16:29 -0300
Subject: fix #5845 added run-gc on webex

---
 .../src/wallet/DeveloperPage.tsx                        | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
index e371775f4..829e60b44 100644
--- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
@@ -36,7 +36,8 @@ export function DeveloperPage(): VNode {
   const [status, timedOut] = useDiagnostics();
 
   const listenAllEvents = Array.from<NotificationType>({ length: 1 });
-  listenAllEvents.includes = () => true; // includes every event
+  //FIXME: waiting for retry notification make a always increasing loop of notifications
+  listenAllEvents.includes = (e) => e !== "waiting-for-retry"; // includes every event
 
   const response = useAsyncAsHook(async () => {
     const op = await wxApi.getPendingOperations();
@@ -160,11 +161,22 @@ export function View({
         onClick={() =>
           confirmReset(
             i18n.str`Do you want to IRREVOCABLY DESTROY everything inside your wallet and LOSE ALL YOUR COINS?`,
+            wxApi.resetDb,
           )
         }
       >
         <i18n.Translate>reset</i18n.Translate>
       </button>
+      <button
+        onClick={() =>
+          confirmReset(
+            i18n.str`TESTING: This may delete all your coin, proceed with caution`,
+            wxApi.runGarbageCollector,
+          )
+        }
+      >
+        <i18n.Translate>run gc</i18n.Translate>
+      </button>
       <br />
       <button onClick={() => fileRef?.current?.click()}>
         <i18n.Translate>import database</i18n.Translate>
@@ -385,9 +397,10 @@ function toBase64(str: string): string {
 
 export async function confirmReset(
   confirmTheResetMessage: string,
+  cb: () => Promise<void>,
 ): Promise<void> {
   if (confirm(confirmTheResetMessage)) {
-    await wxApi.resetDb();
+    await cb();
     window.close();
   }
 }
-- 
cgit v1.2.3

