From 4a7e9a5f3dc8fa1ab4789ac8396b030d72e1facc Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Sat, 9 Mar 2024 17:21:36 -0500
Subject: fix: support new minified class names

bumps decky-frontend-lib to 3.25.0
can't stop us THAT easily :P
---
 frontend/src/toaster.tsx | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

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

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 92a683c2..8f274ff2 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -3,6 +3,7 @@ import {
   Patch,
   ToastData,
   afterPatch,
+  findClass,
   findInReactTree,
   findModuleChild,
   getReactRoot,
@@ -48,16 +49,20 @@ class Toaster extends Logger {
     // ));
     let instance: any;
     const tree = getReactRoot(document.getElementById('root') as any);
+    const toasterClass1 = findClass('GamepadToastPlaceholder');
+    const toasterClass2 = findClass('ToastPlaceholder');
+    const toasterClass3 = findClass('ToastPopup');
+    const toasterClass4 = findClass('GamepadToastPopup');
     const findToasterRoot = (currentNode: any, iters: number): any => {
       if (iters >= 80) {
         // currently 66
         return null;
       }
       if (
-        currentNode?.memoizedProps?.className?.startsWith?.('gamepadtoasts_GamepadToastPlaceholder') ||
-        currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder') ||
-        currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPopup') ||
-        currentNode?.memoizedProps?.className?.startsWith?.('gamepadtoasts_GamepadToastPopup')
+        currentNode?.memoizedProps?.className?.startsWith?.(toasterClass1) ||
+        currentNode?.memoizedProps?.className?.startsWith?.(toasterClass2) ||
+        currentNode?.memoizedProps?.className?.startsWith?.(toasterClass3) ||
+        currentNode?.memoizedProps?.className?.startsWith?.(toasterClass4)
       ) {
         this.log(`Toaster root was found in ${iters} recursion cycles`);
         return currentNode;
-- 
cgit v1.2.3

