mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-12 08:05:15 +02:00
Only call useEffect on mounted
This commit is contained in:
@@ -98,7 +98,7 @@ export class PatcherUtils {
|
||||
}
|
||||
|
||||
static injectUseEffect(str: string, index: number, group: 'Stream' | 'Script', eventName: string) {
|
||||
const newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}));`;
|
||||
const newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}), []);`;
|
||||
str = PatcherUtils.insertAt(str, index, newCode);
|
||||
|
||||
return str;
|
||||
|
Reference in New Issue
Block a user