Select/Highlight draft in Drafts List (not just editor) using javascript


When I load a draft, while it loads in the editor, it doesn’t select / highlight in the Drafts list:


I have to run the action a second time for it to select / highlight in the Drafts list. Is this a bug, or do I need to edit my script at all? I want the draft to both load in the editor and be highlighted in the Drafts List.



For anyone wondering about this in the future, I have figured it out, you need to apply a workspace after loading a draft, and it will select correctly in the sidebar.