From 7f2caa3ea99c8fa9f5b1016c5bafc6f23f99c9ca Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Sat, 3 Feb 2024 00:33:00 -0500
Subject: fix: use findInReactTree to find correct errorboundary for toaster
 fixes toaster error on latest beta

---
 frontend/src/toaster.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'frontend/src/toaster.tsx')

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 0e16bb81..92a683c2 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -81,7 +81,10 @@ class Toaster extends Logger {
       instance = findToasterRoot(tree, 0);
     }
     this.node = instance.return;
-    this.rNode = this.node.return;
+    this.rNode = findInReactTree(
+      this.node.return.return,
+      (node) => node?.stateNode && node.type?.InstallErrorReportingStore,
+    );
     let toast: any;
     let renderedToast: ReactNode = null;
     let innerPatched: any;
-- 
cgit v1.2.3

