mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
Update decky-frontend-lib and refactor patches
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { QuickAccessTab, afterPatch, sleep, unpatch } from 'decky-frontend-lib';
|
||||
import { Patch, QuickAccessTab, afterPatch, sleep } from 'decky-frontend-lib';
|
||||
import { memo } from 'react';
|
||||
|
||||
import Logger from './logger';
|
||||
@@ -35,6 +35,8 @@ class TabsHook extends Logger {
|
||||
private qAPTree: any;
|
||||
private rendererTree: any;
|
||||
|
||||
private cNodePatch?: Patch;
|
||||
|
||||
constructor() {
|
||||
super('TabsHook');
|
||||
|
||||
@@ -60,7 +62,7 @@ class TabsHook extends Logger {
|
||||
}
|
||||
let newQA: any;
|
||||
let newQATabRenderer: any;
|
||||
afterPatch(scrollRoot.stateNode, 'render', (_: any, ret: any) => {
|
||||
this.cNodePatch = afterPatch(scrollRoot.stateNode, 'render', (_: any, ret: any) => {
|
||||
if (!this.quickAccess && ret.props.children.props.children[4]) {
|
||||
this.quickAccess = ret?.props?.children?.props?.children[4].type;
|
||||
newQA = (...args: any) => {
|
||||
@@ -103,7 +105,7 @@ class TabsHook extends Logger {
|
||||
}
|
||||
|
||||
deinit() {
|
||||
if (this.cNode) unpatch(this.cNode.stateNode, 'render');
|
||||
this.cNodePatch?.unpatch();
|
||||
if (this.qAPTree) this.qAPTree.type = this.quickAccess;
|
||||
if (this.rendererTree) this.rendererTree.type = this.tabRenderer;
|
||||
if (this.cNode) this.cNode.stateNode.forceUpdate();
|
||||
|
||||
Reference in New Issue
Block a user