chore: added new command log for export done (#3770)

This commit is contained in:
Kevin Nadro
2024-09-04 16:03:21 -05:00
committed by GitHub
parent 892e856471
commit b19f3bbdb0
2 changed files with 17 additions and 1 deletions

View File

@ -29,6 +29,12 @@ export const ModelStateIndicator = () => {
name="checkmark" name="checkmark"
/> />
) )
} else if (lastCommandType === 'export-done') {
className +=
'border-6 border border-solid border-chalkboard-60 dark:border-chalkboard-80 bg-chalkboard-20 dark:bg-chalkboard-80 !group-disabled:bg-chalkboard-30 !dark:group-disabled:bg-chalkboard-80 rounded-sm bg-succeed-10/30 dark:bg-succeed'
icon = (
<CustomIcon data-testid={dataTestId + '-export-done'} name="checkmark" />
)
} }
return ( return (

View File

@ -1252,6 +1252,10 @@ export type CommandLog =
type: 'execution-done' type: 'execution-done'
data: null data: null
} }
| {
type: 'export-done'
data: null
}
export enum EngineCommandManagerEvents { export enum EngineCommandManagerEvents {
// engineConnection is available but scene setup may not have run // engineConnection is available but scene setup may not have run
@ -1918,7 +1922,13 @@ export class EngineCommandManager extends EventTarget {
} else if (cmd.type === 'export') { } else if (cmd.type === 'export') {
const promise = new Promise<null>((resolve, reject) => { const promise = new Promise<null>((resolve, reject) => {
this.pendingExport = { this.pendingExport = {
resolve, resolve: (passThrough) => {
this.addCommandLog({
type: 'export-done',
data: null,
})
resolve(passThrough)
},
reject: (reason: string) => { reject: (reason: string) => {
this.exportIntent = null this.exportIntent = null
reject(reason) reject(reason)