@@ -159,7 +159,12 @@ let _buildDistFileContent = (api: api, meta3dState: meta3dState, name, displayNa
159159 } = state
160160
161161
162- let model = api . nullable . getExn ( allModelData . get ( category_ ) ) [ api . nullable . getExn ( selectedModelIndex ) ] . model
162+ let model_ = api . nullable . getWithDefault (
163+ api . nullable . map ( selectedModelIndex => {
164+ return api . nullable . getExn ( allModelData . get ( category_ ) ) [ selectedModelIndex ] . model
165+ } , selectedModelIndex ) ,
166+ model . None
167+ )
163168
164169
165170 let updateFuncStr
@@ -306,7 +311,7 @@ let _buildDistFileContent = (api: api, meta3dState: meta3dState, name, displayNa
306311 displayNameEN: "${ displayNameEN } ",
307312 }
308313 },
309- getModel: () => "${ model } ",
314+ getModel: () => "${ model_ } ",
310315 getCategory: () => "${ category_ } ",
311316 getValue: (api, state) => {
312317 return api.${ updateFuncStr } (state, ${ JSON . stringify ( {
@@ -459,6 +464,11 @@ let _getAssetFiles = (api: api, meta3dState: meta3dState, name) => {
459464 return result
460465 } , [ ] )
461466
467+
468+ if ( api . nullable . isNullable ( api . action . getActionState < uploadModelSnapshotState > ( meta3dState , uploadModelSnapshotActionName ) . snapshot ) ) {
469+ return Promise . resolve ( result )
470+ }
471+
462472 return _base64ToUint8Array ( api . nullable . getExn ( api . action . getActionState < uploadModelSnapshotState > ( meta3dState , uploadModelSnapshotActionName ) . snapshot ) ) . then ( data => {
463473 result . push ( [
464474 `./${ name } _model_snapshot.png` ,
0 commit comments