mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-12 16:44:02 +03:00
remove duplicate find in ErrorBoundary
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Patch, callOriginal, findModuleExport, replacePatch } from '@decky/ui';
|
import { ErrorBoundary, Patch, callOriginal, findModuleExport, replacePatch } from '@decky/ui';
|
||||||
|
|
||||||
import DeckyErrorBoundary from './components/DeckyErrorBoundary';
|
import DeckyErrorBoundary from './components/DeckyErrorBoundary';
|
||||||
import Logger from './logger';
|
import Logger from './logger';
|
||||||
@@ -70,15 +70,12 @@ class ErrorBoundaryHook extends Logger {
|
|||||||
return shouldReport ? callOriginal : true;
|
return shouldReport ? callOriginal : true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const ValveErrorBoundary = findModuleExport(
|
if (!ErrorBoundary) {
|
||||||
(e) => e.InstallErrorReportingStore && e?.prototype?.Reset && e?.prototype?.componentDidCatch,
|
|
||||||
);
|
|
||||||
if (!ValveErrorBoundary) {
|
|
||||||
this.error('could not find ValveErrorBoundary');
|
this.error('could not find ValveErrorBoundary');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.errorBoundaryPatch = replacePatch(ValveErrorBoundary.prototype, 'render', function (this: any) {
|
this.errorBoundaryPatch = replacePatch(ErrorBoundary.prototype, 'render', function (this: any) {
|
||||||
if (this.state.error) {
|
if (this.state.error) {
|
||||||
const store = Object.getPrototypeOf(this)?.constructor?.sm_ErrorReportingStore || errorReportingStore;
|
const store = Object.getPrototypeOf(this)?.constructor?.sm_ErrorReportingStore || errorReportingStore;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user