summaryrefslogtreecommitdiff
path: root/frontend/src/toaster.tsx
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2023-12-12 22:21:25 -0500
committerAAGaming <aagaming@riseup.net>2023-12-29 18:40:52 -0500
commit5fd5b2f08cd39a26eecab8901c1d39020c056ac1 (patch)
treec63c493cf26d3143d89e0b8645327149e201bd4d /frontend/src/toaster.tsx
parent87d7e15951232ace425e5107df2300ba8baf749a (diff)
downloaddecky-loader-5fd5b2f08cd39a26eecab8901c1d39020c056ac1.tar.gz
decky-loader-5fd5b2f08cd39a26eecab8901c1d39020c056ac1.zip
fix: Adjust tabs and toaster hooks to work on react 18, also half-fix Valve Internal
Diffstat (limited to 'frontend/src/toaster.tsx')
-rw-r--r--frontend/src/toaster.tsx17
1 files changed, 13 insertions, 4 deletions
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index 7ef4a447..0db8889a 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -1,4 +1,13 @@
-import { Module, Patch, ToastData, afterPatch, findInReactTree, findModuleChild, sleep } from 'decky-frontend-lib';
+import {
+ Module,
+ Patch,
+ ToastData,
+ afterPatch,
+ findInReactTree,
+ findModuleChild,
+ getReactRoot,
+ sleep,
+} from 'decky-frontend-lib';
import { ReactNode } from 'react';
import Toast from './components/Toast';
@@ -38,10 +47,10 @@ class Toaster extends Logger {
// </DeckyToasterStateContextProvider>
// ));
let instance: any;
- const tree = (document.getElementById('root') as any)._reactRootContainer._internalRoot.current;
+ const tree = getReactRoot(document.getElementById('root') as any);
const findToasterRoot = (currentNode: any, iters: number): any => {
- if (iters >= 65) {
- // currently 65
+ if (iters >= 80) {
+ // currently 66
return null;
}
if (