From a84a13c76d99f1e6f4505d43108a4111749e5035 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Sat, 25 May 2024 19:14:54 -0400
Subject: Custom error handler and some misc fixes

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

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

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index c6b15347..7f08cb01 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -1,7 +1,7 @@
+import type { ToastData } from '@decky/api';
 import {
   Export,
   Patch,
-  ToastData,
   afterPatch,
   findClass,
   findInReactTree,
@@ -124,12 +124,12 @@ class Toaster extends Logger {
         this.node.alternate.type = this.node.type;
       }
     };
-    const oRender = this.rNode.stateNode.__proto__.render;
-    let int: NodeJS.Timer | undefined;
+    const oRender = Object.getPrototypeOf(this.rNode.stateNode).render;
+    let int: NodeJS.Timeout | undefined;
     this.rNode.stateNode.render = (...args: any[]) => {
       const ret = oRender.call(this.rNode.stateNode, ...args);
       if (ret && !this?.node?.return?.return) {
-        clearInterval(int);
+        int && clearInterval(int);
         int = setInterval(() => {
           const n = findToasterRoot(tree, 0);
           if (n?.return) {
-- 
cgit v1.2.3

