Skip to content

Commit afed7b0

Browse files
authored
await value for get methods (#19356)
1 parent 3d8707e commit afed7b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Umbraco.Web.UI.Client/src/packages/documents/documents/item/document-item-data-resolver.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class UmbDocumentItemDataResolver<DataType extends UmbDocumentItemDataRes
9090
* @memberof UmbDocumentItemDataResolver
9191
*/
9292
async getUnique(): Promise<string | undefined> {
93-
return this.#data?.getValue()?.unique;
93+
return await this.observe(this.unique).asPromise();
9494
}
9595

9696
/**
@@ -99,7 +99,7 @@ export class UmbDocumentItemDataResolver<DataType extends UmbDocumentItemDataRes
9999
* @memberof UmbDocumentItemDataResolver
100100
*/
101101
async getName(): Promise<string> {
102-
return this.#name.getValue() || '';
102+
return (await this.observe(this.name).asPromise()) || '';
103103
}
104104

105105
/**
@@ -108,7 +108,7 @@ export class UmbDocumentItemDataResolver<DataType extends UmbDocumentItemDataRes
108108
* @memberof UmbDocumentItemDataResolver
109109
*/
110110
async getIcon(): Promise<string | undefined> {
111-
return this.#data?.getValue()?.documentType.icon;
111+
return await this.observe(this.icon).asPromise();
112112
}
113113

114114
/**
@@ -127,7 +127,7 @@ export class UmbDocumentItemDataResolver<DataType extends UmbDocumentItemDataRes
127127
* @memberof UmbDocumentItemDataResolver
128128
*/
129129
async getIsDraft(): Promise<boolean> {
130-
return this.#isDraft.getValue() ?? false;
130+
return (await this.observe(this.isDraft).asPromise()) ?? false;
131131
}
132132

133133
/**
@@ -136,7 +136,7 @@ export class UmbDocumentItemDataResolver<DataType extends UmbDocumentItemDataRes
136136
* @memberof UmbDocumentItemDataResolver
137137
*/
138138
async getIsTrashed(): Promise<boolean> {
139-
return this.#data?.getValue()?.isTrashed ?? false;
139+
return (await this.observe(this.isTrashed).asPromise()) ?? false;
140140
}
141141

142142
#setVariantAwareValues() {

0 commit comments

Comments
 (0)