mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
lint
This commit is contained in:
@@ -29,9 +29,7 @@ const PluginView: FC = () => {
|
|||||||
<Focusable onCancelButton={closeActivePlugin}>
|
<Focusable onCancelButton={closeActivePlugin}>
|
||||||
<TitleView />
|
<TitleView />
|
||||||
<div style={{ height: '100%', paddingTop: '16px' }}>
|
<div style={{ height: '100%', paddingTop: '16px' }}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>{(visible || activePlugin.alwaysRender) && activePlugin.content}</ErrorBoundary>
|
||||||
{(visible || activePlugin.alwaysRender) && activePlugin.content}
|
|
||||||
</ErrorBoundary>
|
|
||||||
</div>
|
</div>
|
||||||
</Focusable>
|
</Focusable>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class ErrorBoundaryHook extends Logger {
|
|||||||
shouldReport,
|
shouldReport,
|
||||||
skipAllReporting: this.doNotReportErrors || this.disableReportingTimer,
|
skipAllReporting: this.doNotReportErrors || this.disableReportingTimer,
|
||||||
});
|
});
|
||||||
if (!shouldReport) this.temporarilyDisableReporting();
|
if (!shouldReport) this.temporarilyDisableReporting();
|
||||||
// react#15069 workaround. this took 2 hours to figure out.
|
// react#15069 workaround. this took 2 hours to figure out.
|
||||||
if (
|
if (
|
||||||
args[0]?.message?.[3]?.[0] &&
|
args[0]?.message?.[3]?.[0] &&
|
||||||
@@ -95,14 +95,14 @@ class ErrorBoundaryHook extends Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public temporarilyDisableReporting() {
|
public temporarilyDisableReporting() {
|
||||||
this.debug("Reporting disabled for 30s due to a non-steam error.");
|
this.debug('Reporting disabled for 30s due to a non-steam error.');
|
||||||
if (this.disableReportingTimer) {
|
if (this.disableReportingTimer) {
|
||||||
clearTimeout(this.disableReportingTimer);
|
clearTimeout(this.disableReportingTimer);
|
||||||
}
|
}
|
||||||
this.disableReportingTimer = setTimeout(() => {
|
this.disableReportingTimer = setTimeout(() => {
|
||||||
this.debug("Reporting re-enabled after 30s timeout.");
|
this.debug('Reporting re-enabled after 30s timeout.');
|
||||||
this.disableReportingTimer = 0;
|
this.disableReportingTimer = 0;
|
||||||
}, 30000)
|
}, 30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ interface Window {
|
|||||||
(async () => {
|
(async () => {
|
||||||
// Wait for react to definitely be loaded
|
// Wait for react to definitely be loaded
|
||||||
while (!window.webpackChunksteamui || window.webpackChunksteamui <= 3) {
|
while (!window.webpackChunksteamui || window.webpackChunksteamui <= 3) {
|
||||||
await new Promise(r => setTimeout(r, 10)); // Can't use DFL sleep here.
|
await new Promise((r) => setTimeout(r, 10)); // Can't use DFL sleep here.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.SP_REACT) {
|
if (!window.SP_REACT) {
|
||||||
|
|||||||
@@ -61,9 +61,7 @@ class RouterHook extends Logger {
|
|||||||
routes.forEach(({ component, props }, path) => {
|
routes.forEach(({ component, props }, path) => {
|
||||||
newRouterArray.push(
|
newRouterArray.push(
|
||||||
<Route path={path} {...props}>
|
<Route path={path} {...props}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>{createElement(component)}</ErrorBoundary>
|
||||||
{createElement(component)}
|
|
||||||
</ErrorBoundary>
|
|
||||||
</Route>,
|
</Route>,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -147,7 +147,11 @@ class TabsHook extends Logger {
|
|||||||
decky: true,
|
decky: true,
|
||||||
initialVisibility: visible,
|
initialVisibility: visible,
|
||||||
};
|
};
|
||||||
tab.panel = <ErrorBoundary><QuickAccessVisibleStateProvider tab={tab}>{content}</QuickAccessVisibleStateProvider></ErrorBoundary>;
|
tab.panel = (
|
||||||
|
<ErrorBoundary>
|
||||||
|
<QuickAccessVisibleStateProvider tab={tab}>{content}</QuickAccessVisibleStateProvider>
|
||||||
|
</ErrorBoundary>
|
||||||
|
);
|
||||||
existingTabs.push(tab);
|
existingTabs.push(tab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function getLikelyErrorSourceFromValveError(error: ValveError): ErrorSour
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getLikelyErrorSourceFromValveReactError(error: ValveReactErrorInfo): ErrorSource {
|
export function getLikelyErrorSourceFromValveReactError(error: ValveReactErrorInfo): ErrorSource {
|
||||||
return getLikelyErrorSource(error?.error?.stack + "\n" + error.info.componentStack);
|
return getLikelyErrorSource(error?.error?.stack + '\n' + error.info.componentStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLikelyErrorSource(error?: string): ErrorSource {
|
export function getLikelyErrorSource(error?: string): ErrorSource {
|
||||||
|
|||||||
Reference in New Issue
Block a user