From 6e839892c86e86841a8d8a2801ba2ef8742bca3c Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 13 Nov 2023 10:02:23 +0100 Subject: [PATCH] use builder pattern to simply connecting --- src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts | 3 +-- src/Umbraco.Web.UI.Client/src/apps/app/server-connection.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts index 547d4d78df..ae130a4a24 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts @@ -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 }); diff --git a/src/Umbraco.Web.UI.Client/src/apps/app/server-connection.ts b/src/Umbraco.Web.UI.Client/src/apps/app/server-connection.ts index 48fb1d9bf4..5655be20f2 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/app/server-connection.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/app/server-connection.ts @@ -19,6 +19,7 @@ export class UmbServerConnection { */ async connect() { await this.#setStatus(); + return this; } /**