feat: Remove references of default editor
This commit is contained in:
@@ -33,10 +33,6 @@ class EditorMenuCtrl extends PureViewCtrl implements EditorMenuScope {
|
|||||||
return this.selectedEditorUuid === editor.uuid;
|
return this.selectedEditorUuid === editor.uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public isEditorDefault(editor: SNComponent) {
|
|
||||||
return this.state.defaultEditor?.uuid === editor.uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
super.$onInit();
|
super.$onInit();
|
||||||
const editors = this.application
|
const editors = this.application
|
||||||
@@ -44,10 +40,8 @@ class EditorMenuCtrl extends PureViewCtrl implements EditorMenuScope {
|
|||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
});
|
});
|
||||||
const defaultEditor = editors.filter((e) => e.isDefaultEditor())[0];
|
|
||||||
this.setState({
|
this.setState({
|
||||||
editors: editors,
|
editors: editors,
|
||||||
defaultEditor: defaultEditor,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user