From bebe9428a6e457ec937eb461fc7b150f5af948be Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Fri, 14 Oct 2022 22:52:46 -0400
Subject: fix old toast patch to not re-create window

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

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

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 8eea35bc..a55c87e6 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -62,6 +62,10 @@ class Toaster extends Logger {
           }
           return ret;
         });
+        this.node.stateNode.shouldComponentUpdate = () => {
+          return false;
+        };
+        delete this.node.stateNode.render;
       }
       return ret;
     };
@@ -102,7 +106,7 @@ class Toaster extends Logger {
 
   deinit() {
     this.instanceRetPatch?.unpatch();
-    this.node && delete this.node.stateNode.render;
+    this.node && delete this.node.stateNode.shouldComponentUpdate;
     this.node && this.node.stateNode.forceUpdate();
   }
 }
-- 
cgit v1.2.3

