Skip to content

Commit

Permalink
fix sprite saving
Browse files Browse the repository at this point in the history
  • Loading branch information
nighca committed Mar 29, 2024
1 parent 2efcac8 commit 8054db4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spx-gui/src/components/editor/sprite-list/AssetAddBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import { stripExt } from '@/utils/path'
import { Backdrop } from '@/models/backdrop'
import { Costume } from '@/models/costume'
import { asset2Backdrop, asset2Sprite } from '@/models/common'
import { sprite2Asset } from '@/models/common'
// ----------props & emit------------------------------------
interface PropType {
Expand Down Expand Up @@ -348,14 +349,14 @@ const handleSubmitSprite = async (): Promise<void> => {
message.success(t('message.success', { uploadSpriteName: uploadSpriteName.value }))
if (publishState.value !== PublishState.noUpload) {
const assetData = await sprite2Asset(sprite)
await addAsset({
...assetData,
displayName: uploadSpriteName.value,
category: categoryValue.value || '',
isPublic:
publishState.value === PublishState.uploadToPersonal ? IsPublic.personal : IsPublic.public,
files: {}, // TODO: upload & get files
preview: 'TODO', // TOOD: gif preview
assetType: AssetType.Sprite
preview: 'TODO' // TODO: we should construct preview at frontend when displaying assets, so we do not need to save `preview` to DB
})
}
Expand Down

0 comments on commit 8054db4

Please sign in to comment.