Skip to content

Commit

Permalink
fix costume add
Browse files Browse the repository at this point in the history
  • Loading branch information
nighca committed Jul 3, 2024
1 parent c8f5676 commit a1785bc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions spx-gui/src/components/asset/preprocessing/PreprocessModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ const selectedCostumes = shallowReactive<Costume[]>([])
/** Update costumes based on current process output */
async function updateCostumes(files: File[]) {
costumes.value = []
selectedCostumes.splice(0)
const newCostumes = await Promise.all(
files.map((file) => Costume.create(stripExt(file.name), file))
)
costumes.value = newCostumes
selectedCostumes.push(...newCostumes)
selectedCostumes.splice(0, selectedCostumes.length, ...newCostumes)
}
function isCostumeSelected(costume: Costume) {
Expand All @@ -196,10 +194,8 @@ function handleConfirm() {
watch(
() => props.files,
async (files) => {
cancelMethod(supportedMethods[0].value)
await updateCostumes(files)
},
// The first method cancelled, all methods cancelled
() => cancelMethod(supportedMethods[0].value),
{ immediate: true }
)
</script>
Expand Down

0 comments on commit a1785bc

Please sign in to comment.