Skip to content

Commit

Permalink
fix: use register/deregister for editors instead of activate/deactivate
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Aug 25, 2020
1 parent b1cde83 commit 696f34b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/assets/javascripts/views/editor/editor_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,19 +348,19 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
/** Unload current component view so that we create a new one */
editorUnloading: true
});
if (newEditor && !newEditor.active) {
/** Activate the new editor while the component view is unloading */
await this.application.componentManager!.activateComponent(newEditor.uuid);
if (newEditor) {
/** Register this new editor while the editor view is reloading */
this.application.componentManager!.registerComponent(newEditor.uuid);
}
await unloading;
const reloading = this.setState({
/** Reload component view */
editorComponent: newEditor,
editorUnloading: false,
});
if (currentEditor?.active) {
/** Deactivate the current (previous) editor while the editor view is reloading */
await this.application.componentManager!.deactivateComponent(currentEditor.uuid);
if (currentEditor) {
/** Deregister the current (previous) editor while the editor view is reloading */
this.application.componentManager!.deregisterComponent(currentEditor.uuid);
}
await reloading;
this.reloadFont();
Expand Down

0 comments on commit 696f34b

Please sign in to comment.