Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: controller.initView should called in specific order #829

Closed
mortalYoung opened this issue Nov 21, 2022 · 0 comments · Fixed by #831
Closed

bug: controller.initView should called in specific order #829

mortalYoung opened this issue Nov 21, 2022 · 0 comments · Fixed by #831
Labels
bug Something isn't working

Comments

@mortalYoung
Copy link
Collaborator

intro

We get the error in console like this:
image

The reason is when editorTreeController be init, it'll call editorService.addPanel -> editorService.addAction -> !headerToolBar -> throw Error. And headerToolBar is assigned in explorerController.initView.

So the conclusion is the explorerController should be called before editorTreeController, and there must be in an order.

But now, we just call it in an easy way

// instanceService.ts
// resolve all controllers, and call `initView` to inject initial values into services
Object.kys(controllers).forEach((key) => {
    const module = controllers[key];
    const controller = container.resolve<Controller>(module);
    controller.initView?.();
});
@mortalYoung mortalYoung added the bug Something isn't working label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant