Skip to content

Commit

Permalink
fix(@lexical/devtools): Now we refresh editors before starting intera…
Browse files Browse the repository at this point in the history
…ctive selection
  • Loading branch information
StyleT committed Apr 23, 2024
1 parent 3fdb8f2 commit 9b872b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function EditorsRefreshCTA({tabID, setErrorMessage}: Props) {
);

injectedPegasusService
.refreshLexicalEditorsForTabID()
.refreshLexicalEditors()
.catch((err) => {
setErrorMessage(err.message);
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ export function EditorInspectorButton({tabID, setErrorMessage}: Props) {
{context: 'window', tabId: tabID},
);

injectedPegasusService.toggleEditorPicker().catch((err) => {
setErrorMessage(err.message);
console.error(err);
});
injectedPegasusService
.refreshLexicalEditors()
.then(() => injectedPegasusService.toggleEditorPicker())
.catch((err) => {
setErrorMessage(err.message);
console.error(err);
});
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class InjectedPegasusService
private readonly commandLog: WeakMap<LexicalEditor, LexicalCommandLog>,
) {}

refreshLexicalEditorsForTabID() {
refreshLexicalEditors() {
scanAndListenForEditors(this.tabID, this.extensionStore, this.commandLog);
}

Expand Down

0 comments on commit 9b872b3

Please sign in to comment.