fix initial load bug in browser

This commit is contained in:
peter
2019-08-06 14:05:31 +02:00
parent dc7494b92d
commit 0371810b65
4 changed files with 10 additions and 7 deletions
@@ -6,7 +6,10 @@ declare const fb
export class DashboardService {
constructor() { }
getWidgetConfigs(): Promise<string[]> {
async getWidgetConfigs(): Promise<string[]> {
while(!fb.PluginManager){
await new Promise((resolve) => setTimeout(resolve, 50))
}
return fb.PluginManager.getLoadedPluginNames()
}
@@ -41,9 +41,7 @@ export class DashboardComponent implements AfterViewInit {
private injector: Injector) { }
ngAfterViewInit() {
setTimeout( () => {
this.loadWidgets();
}, 250)
}
private async loadWidgets() {