|
1 | 1 | import * as React from '@theia/core/shared/react'; |
2 | 2 | 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'; |
4 | 8 | import { NotificationCenterComponent } from './notification-center-component'; |
5 | 9 | import { NotificationToastsComponent } from './notification-toasts-component'; |
6 | 10 | import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/messages/lib/browser/notifications-renderer'; |
| 11 | +import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state'; |
7 | 12 |
|
8 | 13 | @injectable() |
9 | 14 | 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 | + |
10 | 27 | protected override render(): void { |
11 | 28 | ReactDOM.render( |
12 | 29 | <div> |
|
0 commit comments