diff options
| author | AAGaming <aagaming@riseup.net> | 2023-12-12 22:21:25 -0500 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2023-12-12 22:21:25 -0500 |
| commit | 80a00a0d35655791a4e2bc697ad0748fe2c2f9ad (patch) | |
| tree | 1b78623ff497f9b42f1cda1bcf36ab90462096d4 /frontend/src/toaster.tsx | |
| parent | 91186da97940a24c80edcd41991727d43da19456 (diff) | |
| download | decky-loader-80a00a0d35655791a4e2bc697ad0748fe2c2f9ad.tar.gz decky-loader-80a00a0d35655791a4e2bc697ad0748fe2c2f9ad.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.tsx | 17 |
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 ( |
