fix: switch to new page failed after copy page#1361
fix: switch to new page failed after copy page#1361hexqi merged 1 commit intoopentiny:release/v2.5.xfrom
Conversation
WalkthroughThe asynchronous logic for creating a new page in Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
【问题描述】
新建页面/复制页面成功之后,画布有可能切换新页面失败,并提示报错。
【问题分析】
创建页面后,会执行一下步骤:
pageSettingState.updateTreeData()更新页面状态相关变量。该方法为异步。emit('openNewPage', data),将当前编辑页面切换到新创建的页面。getAncestors),获取treeDataMapping中的对应状态。问题:当第 3 步更新比第 1 步的异步更新先执行时,导致了报错。
【解决方案】
pageSettingState.updateTreeData()改为异步等待await pageSettingState.updateTreeData()What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit