use builder pattern to simply connecting

This commit is contained in:
Mads Rasmussen
2023-11-13 10:02:23 +01:00
parent 8149a09eb9
commit 6e839892c8
2 changed files with 2 additions and 2 deletions

View File

@@ -83,8 +83,7 @@ export class UmbAppElement extends UmbLitElement {
*/
OpenAPI.BASE = this.serverUrl;
this.#serverConnection = new UmbServerConnection(this.serverUrl);
await this.#serverConnection.connect();
this.#serverConnection = await new UmbServerConnection(this.serverUrl).connect();
this.#authContext = new UmbAuthContext(this, this.serverUrl, this.backofficePath, this.bypassAuth);
new UmbAppContext(this, { backofficePath: this.backofficePath, serverUrl: this.serverUrl });

View File

@@ -19,6 +19,7 @@ export class UmbServerConnection {
*/
async connect() {
await this.#setStatus();
return this;
}
/**