Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code-editor for animation #629

Merged
merged 3 commits into from
Jul 4, 2024
Merged

Update code-editor for animation #629

merged 3 commits into from
Jul 4, 2024

Conversation

nighca
Copy link
Collaborator

@nighca nighca commented Jul 2, 2024

@@ -196,10 +194,8 @@ function handleConfirm() {

watch(
() => props.files,
async (files) => {
cancelMethod(supportedMethods[0].value)
Copy link
Collaborator Author

@nighca nighca Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里修复之前 #614 引入的 bug:添加 costume 时选择一张图片会得到两个 costume

cancelMethod 也会触发 updateCostumes,因此会触发几乎同时的两次 updateCostumes 调用(对应相同的参数)

updateCostumes 里边

  1. 清空 selectedCostumes
  2. selectedCostumes 中添加新的 costumes

两个动作之间间隔了 await Promise.all() 的过程;因此两次 updateCostumes 调用对应地清空了两次 selectedCostumes,然后又向 selectedCostumes 中添加了两次新的 costumes

最终导致输入一个文件,而 selectedCostumes 中保存了两个 costume

@qiniu-ci
Copy link

qiniu-ci commented Jul 3, 2024

The PR environment is ready, please check the PR environment

[Attention]: This environment will be automatically cleaned up after a certain period of time., please make sure to test it in time. If you have any questions, please contact the builder team.

@aofei aofei merged commit d534306 into goplus:dev Jul 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants