mirror of
https://gitlab.com/comunic/comunicconsole
synced 2025-03-14 10:12:38 +00:00
39 lines
764 B
TypeScript
39 lines
764 B
TypeScript
|
/**
|
||
|
* Initialization widget
|
||
|
*
|
||
|
* @author Pierre Hubert
|
||
|
*/
|
||
|
|
||
|
import React from "react";
|
||
|
import { AsyncWidget } from "./AsyncWidget";
|
||
|
|
||
|
|
||
|
export class InitWidget extends React.Component {
|
||
|
|
||
|
constructor(props: any) {
|
||
|
super(props);
|
||
|
|
||
|
this.init = this.init.bind(this);
|
||
|
this.build = this.build.bind(this);
|
||
|
}
|
||
|
|
||
|
async init() {
|
||
|
await new Promise((res, rej) => {
|
||
|
setTimeout(() => {
|
||
|
rej(null);
|
||
|
}, 500)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
return (<AsyncWidget
|
||
|
errorMessage = "Failed to initialize application!"
|
||
|
load = {this.init}
|
||
|
onBuild = {this.build}
|
||
|
></AsyncWidget>);
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
return (<div>yes !!! done !!!</div>);
|
||
|
}
|
||
|
}
|