diff options
| author | AAGaming <aa@mail.catvibers.me> | 2022-10-02 10:29:33 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2022-10-02 10:29:33 -0400 |
| commit | 19d5527bdfe2a1de9719dc4df838b22aed254797 (patch) | |
| tree | 73ee8b84409cbbca098bcbf828c83bf71784e784 /frontend/src/toaster.tsx | |
| parent | ef51b96f082e63abb1db1f8eb5e0ba88e64d82a7 (diff) | |
| download | decky-loader-19d5527bdfe2a1de9719dc4df838b22aed254797.tar.gz decky-loader-19d5527bdfe2a1de9719dc4df838b22aed254797.zip | |
ACTUALLY FIX the friends focus workaround
Diffstat (limited to 'frontend/src/toaster.tsx')
| -rw-r--r-- | frontend/src/toaster.tsx | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx index 2103da5f..8eea35bc 100644 --- a/frontend/src/toaster.tsx +++ b/frontend/src/toaster.tsx @@ -1,14 +1,4 @@ -import { - Patch, - ToastData, - afterPatch, - callOriginal, - findInReactTree, - findModuleChild, - replacePatch, - sleep, - staticClasses, -} from 'decky-frontend-lib'; +import { Patch, ToastData, afterPatch, findInReactTree, findModuleChild, sleep } from 'decky-frontend-lib'; import { ReactNode } from 'react'; import Toast from './components/Toast'; @@ -37,35 +27,6 @@ class Toaster extends Logger { async init() { let instance: any; - const self = this; - const focusManager = findModuleChild((m) => { - if (typeof m !== 'object') return false; - for (let prop in m) { - if (m[prop]?.prototype?.TakeFocus) return m[prop]; - } - return false; - }); - - const overrideFocus = function () { - // @ts-ignore - self.debug(this.m_node.m_element); - // @ts-ignore - const classList = this.m_node?.m_element.classList; - if ( - // @ts-ignore - (this.m_node?.m_element && classList.contains(staticClasses.TabGroupPanel)) || - classList.contains('FriendsListTab') || - classList.contains('FriendsTabList') || - classList.contains('FriendsListAndChatsSteamDeck') - ) { - self.debug('Intercepted friends re-focus'); - return true; - } - - return callOriginal; - }; - - const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'TakeFocus', overrideFocus); while (true) { instance = findInReactTree( @@ -111,7 +72,6 @@ class Toaster extends Logger { if (typeof m[prop]?.settings && m[prop]?.communityPreferences) return m[prop]; } }); - focusWorkaroundPatch.unpatch(); this.log('Initialized'); this.ready = true; } |
