mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-14 06:46:36 +00:00
Defer notification area rendering until app ready.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
7a3e6789d1
commit
8a1cabd2bc
@ -1,12 +1,29 @@
|
|||||||
import * as React from '@theia/core/shared/react';
|
import * as React from '@theia/core/shared/react';
|
||||||
import * as ReactDOM from '@theia/core/shared/react-dom';
|
import * as ReactDOM from '@theia/core/shared/react-dom';
|
||||||
import { injectable } from '@theia/core/shared/inversify';
|
import {
|
||||||
|
inject,
|
||||||
|
injectable,
|
||||||
|
postConstruct,
|
||||||
|
} from '@theia/core/shared/inversify';
|
||||||
import { NotificationCenterComponent } from './notification-center-component';
|
import { NotificationCenterComponent } from './notification-center-component';
|
||||||
import { NotificationToastsComponent } from './notification-toasts-component';
|
import { NotificationToastsComponent } from './notification-toasts-component';
|
||||||
import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/messages/lib/browser/notifications-renderer';
|
import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/messages/lib/browser/notifications-renderer';
|
||||||
|
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class NotificationsRenderer extends TheiaNotificationsRenderer {
|
export class NotificationsRenderer extends TheiaNotificationsRenderer {
|
||||||
|
@inject(FrontendApplicationStateService)
|
||||||
|
private readonly appStateService: FrontendApplicationStateService;
|
||||||
|
|
||||||
|
@postConstruct()
|
||||||
|
protected override init(): void {
|
||||||
|
// Unlike Theia, IDE2 renders the notification area only when the app is ready.
|
||||||
|
this.appStateService.reachedState('ready').then(() => {
|
||||||
|
this.createOverlayContainer();
|
||||||
|
this.render();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected override render(): void {
|
protected override render(): void {
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user