Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8a1cabd

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Defer notification area rendering until app ready.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 7a3e678 commit 8a1cabd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

‎arduino-ide-extension/src/browser/theia/messages/notifications-renderer.tsx‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
import * as React from '@theia/core/shared/react';
22
import * as ReactDOM from '@theia/core/shared/react-dom';
3-
import { injectable } from '@theia/core/shared/inversify';
3+
import {
4+
inject,
5+
injectable,
6+
postConstruct,
7+
} from '@theia/core/shared/inversify';
48
import { NotificationCenterComponent } from './notification-center-component';
59
import { NotificationToastsComponent } from './notification-toasts-component';
610
import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/messages/lib/browser/notifications-renderer';
11+
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
712

813
@injectable()
914
export class NotificationsRenderer extends TheiaNotificationsRenderer {
15+
@inject(FrontendApplicationStateService)
16+
private readonly appStateService: FrontendApplicationStateService;
17+
18+
@postConstruct()
19+
protected override init(): void {
20+
// Unlike Theia, IDE2 renders the notification area only when the app is ready.
21+
this.appStateService.reachedState('ready').then(() => {
22+
this.createOverlayContainer();
23+
this.render();
24+
});
25+
}
26+
1027
protected override render(): void {
1128
ReactDOM.render(
1229
<div>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /