Skip to content

Commit 8a63067

Browse files
authored
fix: adjust the order of controller (#831)
1 parent 9418d40 commit 8a63067

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

src/services/instanceService.tsx

+41-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
import { ReactElement } from 'react';
22
import { ILocale } from 'mo/i18n';
33
import { container } from 'tsyringe';
4-
import * as controllers from 'mo/controller';
54
import type { Controller } from 'mo/react';
65
import { defaultExtensions } from 'mo/extensions';
76
import { GlobalEvent } from 'mo/common/event';
87
import { IConfigProps } from 'mo/provider/create';
98
import { IExtension } from 'mo/model';
109
import { STORE_KEY } from 'mo/i18n/localeService';
1110
import molecule from 'mo';
11+
import {
12+
ActivityBarController,
13+
EditorController,
14+
EditorTreeController,
15+
ExplorerController,
16+
ExtensionController,
17+
FolderTreeController,
18+
LayoutController,
19+
MenuBarController,
20+
NotificationController,
21+
OutlineController,
22+
PanelController,
23+
ProblemsController,
24+
SearchController,
25+
SettingsController,
26+
SidebarController,
27+
StatusBarController,
28+
} from 'mo/controller';
1229

1330
interface IInstanceServiceProps {
1431
getConfig: () => IConfigProps;
@@ -70,6 +87,29 @@ export default class InstanceService
7087
);
7188
this.initialLocaleService(languages);
7289

90+
const controllers = [
91+
ActivityBarController,
92+
EditorController,
93+
/**
94+
* Explorer should called before EditorTreeController,
95+
* @refer https://github.com/DTStack/molecule/issues/829
96+
*/
97+
ExplorerController,
98+
EditorTreeController,
99+
ExtensionController,
100+
FolderTreeController,
101+
LayoutController,
102+
MenuBarController,
103+
NotificationController,
104+
OutlineController,
105+
PanelController,
106+
ProblemsController,
107+
SearchController,
108+
SettingsController,
109+
SidebarController,
110+
StatusBarController,
111+
];
112+
73113
// resolve all controllers, and call `initView` to inject initial values into services
74114
Object.keys(controllers).forEach((key) => {
75115
const module = controllers[key];

0 commit comments

Comments
 (0)