mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-10 23:27:46 +02:00
Only call useEffect on mounted
This commit is contained in:
2
dist/better-xcloud.pretty.user.js
vendored
2
dist/better-xcloud.pretty.user.js
vendored
@@ -5179,7 +5179,7 @@ class PatcherUtils {
|
||||
return str.substring(start, end);
|
||||
}
|
||||
static injectUseEffect(str, index, group, eventName) {
|
||||
let newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}));`;
|
||||
let newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}), []);`;
|
||||
return str = PatcherUtils.insertAt(str, index, newCode), str;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user