From 3e120ea312dc303c66c9e2e0a607a1ae2ebdfc37 Mon Sep 17 00:00:00 2001
From: Marco Rodolfi <marco.rodolfi@tuta.io>
Date: Tue, 7 Feb 2023 02:30:44 +0100
Subject: Fix class name shenanigans for toast notification (#366)

* Fix class name shenanigans for  toast notification

* Corrected number of iterations
---
 frontend/src/toaster.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 1b2e9b80..b636d7b3 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -40,11 +40,14 @@ class Toaster extends Logger {
     let instance: any;
     const tree = (document.getElementById('root') as any)._reactRootContainer._internalRoot.current;
     const findToasterRoot = (currentNode: any, iters: number): any => {
-      if (iters >= 50) {
-        // currently 40
+      if (iters >= 65) {
+        // currently 65
         return null;
       }
-      if (currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder')) {
+      if (
+        currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder') ||
+        currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPopup')
+      ) {
         this.log(`Toaster root was found in ${iters} recursion cycles`);
         return currentNode;
       }
-- 
cgit v1.2.3

