fix core dump screenshot (#2911)

* fix core dump screenshot

* make it robust
This commit is contained in:
Kurt Hutten
2024-07-04 15:58:29 +10:00
committed by GitHub
parent 6370d45f94
commit 0dfee64e3b
7 changed files with 18 additions and 44 deletions

View File

@ -10,12 +10,10 @@ Please do not fill this up with junk.
interface AppState {
isStreamReady: boolean
htmlRef: React.RefObject<HTMLDivElement> | null
setAppState: (newAppState: Partial<AppState>) => void
}
const AppStateContext = createContext<AppState>({
htmlRef: null,
isStreamReady: false,
setAppState: () => {},
})
@ -24,7 +22,6 @@ export const useAppState = () => useContext(AppStateContext)
export const AppStateProvider = ({ children }: { children: ReactNode }) => {
const [appState, _setAppState] = useState<AppState>({
htmlRef: null,
isStreamReady: false,
setAppState: () => {},
})
@ -34,7 +31,6 @@ export const AppStateProvider = ({ children }: { children: ReactNode }) => {
return (
<AppStateContext.Provider
value={{
htmlRef: appState.htmlRef,
isStreamReady: appState.isStreamReady,
setAppState,
}}