summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2024-03-09 17:21:36 -0500
committerAAGaming <aagaming@riseup.net>2024-04-22 13:18:33 -0400
commit6b06bae250f6020b92b49595d601cd196f4d71e0 (patch)
treee08d1b2588b8f125b71347d804251b76f842e566 /frontend/src
parent9a0a52f9e3d2a7d64f2c7802e9c1b3772e4ec08e (diff)
downloaddecky-loader-6b06bae250f6020b92b49595d601cd196f4d71e0.tar.gz
decky-loader-6b06bae250f6020b92b49595d601cd196f4d71e0.zip
fix: support new minified class names
bumps decky-frontend-lib to 3.25.0 can't stop us THAT easily :P
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/toaster.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index c988dbbb..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,15 +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?.(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;