[MM-63899] Stop blocking of server loading on contact with each configured server (#3409)

This commit is contained in:
Devin Binnie
2025-04-29 12:35:36 -04:00
committed by GitHub
parent 88e29e9997
commit 4848b9768c

View File

@@ -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);