trigger temporarilyDisableReporting in errorboundary

This commit is contained in:
AAGaming
2024-06-27 00:08:32 -04:00
parent c36f1985bd
commit c2f8cba4af
@@ -32,8 +32,9 @@ const DeckyErrorBoundary: FunctionComponent<DeckyErrorBoundaryProps> = ({ error,
const [debugAllowed, setDebugAllowed] = useState<boolean>(true); const [debugAllowed, setDebugAllowed] = useState<boolean>(true);
// Intentionally doesn't use DeckyState. // Intentionally doesn't use DeckyState.
const [versionInfo, setVersionInfo] = useState<VerInfo>(); const [versionInfo, setVersionInfo] = useState<VerInfo>();
const [errorSource, wasCausedByPlugin] = getLikelyErrorSourceFromValveReactError(error); const [errorSource, wasCausedByPlugin, shouldReportToValve] = getLikelyErrorSourceFromValveReactError(error);
useEffect(() => { useEffect(() => {
if (!shouldReportToValve) DeckyPluginLoader.errorBoundaryHook.temporarilyDisableReporting();
DeckyPluginLoader.updateVersion().then(setVersionInfo); DeckyPluginLoader.updateVersion().then(setVersionInfo);
}, []); }, []);
return ( return (
@@ -64,7 +65,7 @@ const DeckyErrorBoundary: FunctionComponent<DeckyErrorBoundaryProps> = ({ error,
userSelect: 'auto', userSelect: 'auto',
}} }}
> >
An error occured rendering this content. An error occured while rendering this content.
</h1> </h1>
<pre style={{}}> <pre style={{}}>
<code> <code>