Skip to content

Commit

Permalink
Merge pull request #2111 from epam/fix/init-itemsStorage-appropriately
Browse files Browse the repository at this point in the history
[ArrayDataSource]: Fixed initialization of items storage appropriately.
  • Loading branch information
Kuznietsov authored Apr 4, 2024
2 parents 48733f5 + f5263e9 commit 39b5bd1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions uui-core/src/data/processing/ArrayDataSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,11 @@ export class ArrayDataSource<TItem = any, TId = any, TFilter = any> extends Base
this.setProps(props);
const params = { getId: this.getId, complexIds: props.complexIds };
this.itemsStatusMap = newMap(params);
this.itemsStorage = new ItemsStorage({ items: [], params: params });
}

public setProps(props: ArrayDataSourceProps<TItem, TId, TFilter>) {
const currentItems = this.props?.items;
this.props = props;
if (props.items && currentItems !== props.items) {
if (!this.itemsStorage) {
this.itemsStorage = new ItemsStorage({
items: [],
params: { getId: this.getId, complexIds: this.props.complexIds },
});
}
}
}

public getById = (id: TId): TItem | undefined => {
Expand Down

0 comments on commit 39b5bd1

Please sign in to comment.