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

Editor: Fixed selected object unselected when recovering #28318

Merged
merged 1 commit into from
May 8, 2024

Conversation

ycw
Copy link
Contributor

@ycw ycw commented May 8, 2024

The issue: The selected scene object in outliner becomes unselected when recovering

To reproduce:

  1. Select a scene object in outliner
  2. Refresh the page
  3. You should see nothing is being selected in outliner

This cause: "Restoring selected object" editor.selectByUuid() should follow "Restoring the editor" editor.fromJSON(), however, editor.fromJSON() returns a promise which ... isn't be awaited ... , so the order is reversed and failed as expected.

This PR fixed that by simply awaiting the editor.fromJSON() .

@mrdoob mrdoob added this to the r165 milestone May 8, 2024
@mrdoob mrdoob merged commit 232b4ea into mrdoob:dev May 8, 2024
8 of 12 checks passed
@ycw
Copy link
Contributor Author

ycw commented May 8, 2024

Clarify that this PR can only restore selected state if selected object is a scene object. i.e. If users selected default Camera or Scene, there will be nothing auto-selected in outliner after restoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants