Skip to content

Commit fb3609d

Browse files
committed
allow for undefined
1 parent b8928ba commit fb3609d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/repository/repository-items.manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export class UmbRepositoryItemsManager<ItemType extends { unique: string }> exte
7676
return this.#uniques.getValue();
7777
}
7878

79-
setUniques(uniques: string[]): void {
80-
this.#uniques.setValue(uniques);
79+
setUniques(uniques: string[] | undefined): void {
80+
this.#uniques.setValue(uniques ?? []);
8181
}
8282

8383
getItems(): Array<ItemType> {

src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export type UmbSorterConfig<T, ElementType extends HTMLElement = HTMLElement> =
221221
Partial<Pick<INTERNAL_UmbSorterConfig<T, ElementType>, 'ignorerSelector' | 'containerSelector' | 'identifier'>>;
222222

223223
/**
224-
224+
225225
* @class UmbSorterController
226226
* @implements {UmbControllerInterface}
227227
* @description This controller can make user able to sort items.
@@ -346,10 +346,8 @@ export class UmbSorterController<T, ElementType extends HTMLElement = HTMLElemen
346346
}
347347
}
348348

349-
setModel(model: Array<T>): void {
350-
if (this.#model) {
351-
this.#model = model;
352-
}
349+
setModel(model: Array<T> | undefined): void {
350+
this.#model = model ?? [];
353351
}
354352

355353
/**

0 commit comments

Comments
 (0)