mirror of
https://github.com/invoke-ai/InvokeAI
synced 2026-03-02 13:09:06 +01:00
tidy(ui): lift error boundary reset cb outside component
This commit is contained in:
parent
c80c89dfdb
commit
0742ebe11a
@ -3,22 +3,22 @@ import { GlobalHookIsolator } from 'app/components/GlobalHookIsolator';
|
||||
import { GlobalModalIsolator } from 'app/components/GlobalModalIsolator';
|
||||
import { clearStorage } from 'app/store/enhancers/reduxRemember/driver';
|
||||
import { AppContent } from 'features/ui/components/AppContent';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { memo } from 'react';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
|
||||
import AppErrorBoundaryFallback from './AppErrorBoundaryFallback';
|
||||
import ThemeLocaleProvider from './ThemeLocaleProvider';
|
||||
|
||||
const App = () => {
|
||||
const handleReset = useCallback(() => {
|
||||
clearStorage();
|
||||
location.reload();
|
||||
return false;
|
||||
}, []);
|
||||
const errorBoundaryOnReset = () => {
|
||||
clearStorage();
|
||||
location.reload();
|
||||
return false;
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<ThemeLocaleProvider>
|
||||
<ErrorBoundary onReset={handleReset} FallbackComponent={AppErrorBoundaryFallback}>
|
||||
<ErrorBoundary onReset={errorBoundaryOnReset} FallbackComponent={AppErrorBoundaryFallback}>
|
||||
<Box id="invoke-app-wrapper" w="100dvw" h="100dvh" position="relative" overflow="hidden">
|
||||
<AppContent />
|
||||
</Box>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user