File tree Expand file tree Collapse file tree
editor/src/editor/layout/inspector/sprites Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ export class EditorSpriteManagerNodeInspector extends Component<IEditorInspector
254254 } }
255255 />
256256
257- { this . props . object . spritesheet && (
257+ { this . props . object . spritesheet && ! this . props . object . atlasJsonRelativePath && (
258258 < div className = "flex flex-col gap-2 w-full" >
259259 < div
260260 style = { {
@@ -296,6 +296,9 @@ export class EditorSpriteManagerNodeInspector extends Component<IEditorInspector
296296
297297 registerUndoRedo ( {
298298 executeRedo : true ,
299+ action : ( ) => {
300+ this . props . object . _previews = [ ] ;
301+ } ,
299302 undo : async ( ) => {
300303 this . props . object . disposeSpriteManager ( ) ;
301304
@@ -398,9 +401,10 @@ export class EditorSpriteManagerNodeInspector extends Component<IEditorInspector
398401 const path = JSON . parse ( ev . dataTransfer . getData ( "assets" ) ) [ 0 ] ;
399402 const extension = extname ( path ) . toLowerCase ( ) ;
400403 if ( extension === ".json" ) {
401- await this . props . object . buildFromAtlasJsonAbsolutePath ( path ) ;
402- await this . _computeSpritePreviewImages ( ) ;
403- this . forceUpdate ( ) ;
404+ this . props . object . _previews = [ ] ;
405+ this . props . object . buildFromAtlasJsonAbsolutePath ( path ) ;
406+
407+ this . _computeSpritePreviewImages ( ) ;
404408 }
405409 } }
406410 className = { `
You can’t perform that action at this time.
0 commit comments