[MM-63899] Stop blocking of server loading on contact with each configured server (#3409)
This commit is contained in:
@@ -100,13 +100,23 @@ export class ViewManager {
|
|||||||
if (ServerManager.hasServers()) {
|
if (ServerManager.hasServers()) {
|
||||||
// TODO: This init should be happening elsewhere, future refactor will fix this
|
// TODO: This init should be happening elsewhere, future refactor will fix this
|
||||||
ServerViewState.init();
|
ServerViewState.init();
|
||||||
await updateServerInfos(ServerManager.getAllServers());
|
|
||||||
LoadingScreen.show();
|
LoadingScreen.show();
|
||||||
ServerManager.getAllServers().forEach((server) => this.loadServer(server));
|
|
||||||
|
// We need to wait for the current server to be initialized before showing anything
|
||||||
|
// But we can initialize other servers in parallel
|
||||||
|
const otherServers = ServerManager.getAllServers().filter((server) => server.id !== ServerViewState.getCurrentServer().id);
|
||||||
|
const currentServer = ServerViewState.getCurrentServer();
|
||||||
|
otherServers.forEach((server) => this.initServer(server));
|
||||||
|
await this.initServer(currentServer);
|
||||||
this.showInitial();
|
this.showInitial();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private initServer = async (server: MattermostServer) => {
|
||||||
|
await updateServerInfos([server]);
|
||||||
|
this.loadServer(server);
|
||||||
|
};
|
||||||
|
|
||||||
private handleDeveloperModeUpdated = (json: DeveloperSettings) => {
|
private handleDeveloperModeUpdated = (json: DeveloperSettings) => {
|
||||||
log.debug('handleDeveloperModeUpdated', json);
|
log.debug('handleDeveloperModeUpdated', json);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user