mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 15:02:03 +00:00
Fix class name shenanigans for toast notification (#366)
* Fix class name shenanigans for toast notification * Corrected number of iterations
This commit is contained in:
@@ -40,11 +40,14 @@ class Toaster extends Logger {
|
|||||||
let instance: any;
|
let instance: any;
|
||||||
const tree = (document.getElementById('root') as any)._reactRootContainer._internalRoot.current;
|
const tree = (document.getElementById('root') as any)._reactRootContainer._internalRoot.current;
|
||||||
const findToasterRoot = (currentNode: any, iters: number): any => {
|
const findToasterRoot = (currentNode: any, iters: number): any => {
|
||||||
if (iters >= 50) {
|
if (iters >= 65) {
|
||||||
// currently 40
|
// currently 65
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder')) {
|
if (
|
||||||
|
currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPlaceholder') ||
|
||||||
|
currentNode?.memoizedProps?.className?.startsWith?.('toastmanager_ToastPopup')
|
||||||
|
) {
|
||||||
this.log(`Toaster root was found in ${iters} recursion cycles`);
|
this.log(`Toaster root was found in ${iters} recursion cycles`);
|
||||||
return currentNode;
|
return currentNode;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user