mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
Stop using MutationObserver in stream-ui
This commit is contained in:
@@ -1156,6 +1156,18 @@ ${subsVar} = subs;
|
||||
str = PatcherUtils.insertAt(str, index, newCode);
|
||||
return str;
|
||||
},
|
||||
|
||||
injectStreamMenuUseEffect(str: string) {
|
||||
let index = str.indexOf('"StreamMenu-module__container');
|
||||
index > -1 && (index = PatcherUtils.lastIndexOf(str, 'return', index, 200));
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.Stream.emit('ui.streamMenu.rendered', {}));`;
|
||||
str = PatcherUtils.insertAt(str, index, newCode);
|
||||
return str;
|
||||
},
|
||||
};
|
||||
|
||||
let PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
@@ -1265,6 +1277,8 @@ let STREAM_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
|
||||
'alwaysShowStreamHud',
|
||||
|
||||
'injectStreamMenuUseEffect',
|
||||
|
||||
// 'exposeEventTarget',
|
||||
|
||||
// Patch volume control for normal stream
|
||||
|
Reference in New Issue
Block a user