loading progress

This commit is contained in:
Alexander Bentkamp
2023-11-28 11:43:32 +01:00
parent 241ef4b67a
commit f6727e5c9f
5 changed files with 118 additions and 3 deletions
+7 -1
View File
@@ -347,6 +347,7 @@ export function TypewriterInterface({props}) {
const uri = model.uri.toString()
const [disableInput, setDisableInput] = React.useState<boolean>(false)
const [loadingProgress, setLoadingProgress] = React.useState<number>(0)
const { setDeletedChat, showHelp, setShowHelp } = React.useContext(DeletedChatContext)
const {mobile} = React.useContext(MobileContext)
const { proof } = React.useContext(ProofContext)
@@ -455,6 +456,11 @@ export function TypewriterInterface({props}) {
let lastStepErrors = proof.length ? hasInteractiveErrors(proof[proof.length - 1].errors) : false
useServerNotificationEffect("$/game/loading", (params : any) => {
setLoadingProgress(params.counter)
})
return <div className="typewriter-interface">
<RpcContext.Provider value={rpcSess}>
<div className="content">
@@ -521,7 +527,7 @@ export function TypewriterInterface({props}) {
}
</div>
}
</> : <CircularProgress />
</> : <CircularProgress variant="determinate" value={loadingProgress/1.5 + 30} />
}
</div>
</div>