From ba6a0fcfe0e1c7247ad164454348c721723577cd Mon Sep 17 00:00:00 2001 From: Richard Ockerby Date: Fri, 30 May 2025 13:31:17 +0100 Subject: [PATCH] Update references to Umbraco User model (Extension Template) (#19349) Update references to Umbraco User model In the template dashboard, update the type reference for the umbraco user --- .../Client/src/dashboards/dashboard.element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/UmbracoExtension/Client/src/dashboards/dashboard.element.ts b/templates/UmbracoExtension/Client/src/dashboards/dashboard.element.ts index a5a9ee0a22..4d5f99562b 100644 --- a/templates/UmbracoExtension/Client/src/dashboards/dashboard.element.ts +++ b/templates/UmbracoExtension/Client/src/dashboards/dashboard.element.ts @@ -8,7 +8,7 @@ import { import { UmbElementMixin } from "@umbraco-cms/backoffice/element-api"; import { UUIButtonElement } from "@umbraco-cms/backoffice/external/uui"; import { UMB_NOTIFICATION_CONTEXT } from "@umbraco-cms/backoffice/notification"; -import { UMB_CURRENT_USER_CONTEXT } from "@umbraco-cms/backoffice/current-user"; +import { UMB_CURRENT_USER_CONTEXT, UmbCurrentUserModel } from "@umbraco-cms/backoffice/current-user"; import { UmbracoExtensionService, UserModel } from "../api/index.js"; @customElement("example-dashboard") @@ -23,7 +23,7 @@ export class ExampleDashboardElement extends UmbElementMixin(LitElement) { private _serverUserData?: UserModel; @state() - private _contextCurrentUser?: typeof UMB_CURRENT_USER_CONTEXT.TYPE; + private _contextCurrentUser?: UmbCurrentUserModel; #notificationContext?: typeof UMB_NOTIFICATION_CONTEXT.TYPE; @@ -39,7 +39,7 @@ export class ExampleDashboardElement extends UmbElementMixin(LitElement) { // We can observe properties from it, such as the current user or perhaps just individual properties // When the currentUser object changes we will get notified and can reset the @state properrty this.observe( - currentUserContext.currentUser, + currentUserContext?.currentUser, (currentUser) => { this._contextCurrentUser = currentUser; },