remove the maxNumber checking
This commit is contained in:
parent
890a2f0a9b
commit
8484a4a2a4
|
@ -173,28 +173,19 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
|
||||||
*/
|
*/
|
||||||
private _readItems(): Promise<void> {
|
private _readItems(): Promise<void> {
|
||||||
this.clearError();
|
this.clearError();
|
||||||
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
||||||
|
|
||||||
if (this._dataProvider.maxNumberOfTasks > this._todoComponentData.selectedListItems.length) {
|
return this._dataProvider.readItems()
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
.then(
|
||||||
|
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
||||||
return this._dataProvider.readItems()
|
selectedListItems: items,
|
||||||
.then(
|
loadingStatus: LoadingStatus.None
|
||||||
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
}),
|
||||||
selectedListItems: items,
|
(error: Error) => {
|
||||||
loadingStatus: LoadingStatus.None
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
||||||
}),
|
this.renderError(error);
|
||||||
(error: Error) => {
|
}
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
);
|
||||||
this.renderError(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
this._renderTodoComponent({
|
|
||||||
selectedListItems: this._todoComponentData.selectedListItems.slice(0, this._dataProvider.maxNumberOfTasks)
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -316,28 +316,19 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
|
||||||
*/
|
*/
|
||||||
private _readItems(): Promise<void> {
|
private _readItems(): Promise<void> {
|
||||||
this.clearError();
|
this.clearError();
|
||||||
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
||||||
|
|
||||||
if (this._dataProvider.maxNumberOfTasks > this._todoComponentData.selectedListItems.length) {
|
return this._dataProvider.readItems()
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
.then(
|
||||||
|
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
||||||
return this._dataProvider.readItems()
|
selectedListItems: items,
|
||||||
.then(
|
loadingStatus: LoadingStatus.None
|
||||||
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
}),
|
||||||
selectedListItems: items,
|
(error: Error) => {
|
||||||
loadingStatus: LoadingStatus.None
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
||||||
}),
|
this.renderError(error);
|
||||||
(error: Error) => {
|
}
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
);
|
||||||
this.renderError(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
this._renderTodoComponent({
|
|
||||||
selectedListItems: this._todoComponentData.selectedListItems.slice(0, this._dataProvider.maxNumberOfTasks)
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -316,28 +316,19 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
|
||||||
*/
|
*/
|
||||||
private _readItems(): Promise<void> {
|
private _readItems(): Promise<void> {
|
||||||
this.clearError();
|
this.clearError();
|
||||||
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
||||||
|
|
||||||
if (this._dataProvider.maxNumberOfTasks > this._todoComponentData.selectedListItems.length) {
|
return this._dataProvider.readItems()
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.FetchingTasks });
|
.then(
|
||||||
|
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
||||||
return this._dataProvider.readItems()
|
selectedListItems: items,
|
||||||
.then(
|
loadingStatus: LoadingStatus.None
|
||||||
(items: ITodoTask[]) => items && this._renderTodoComponent({
|
}),
|
||||||
selectedListItems: items,
|
(error: Error) => {
|
||||||
loadingStatus: LoadingStatus.None
|
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
||||||
}),
|
this.renderError(error);
|
||||||
(error: Error) => {
|
}
|
||||||
this._renderTodoComponent({ loadingStatus: LoadingStatus.None });
|
);
|
||||||
this.renderError(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
this._renderTodoComponent({
|
|
||||||
selectedListItems: this._todoComponentData.selectedListItems.slice(0, this._dataProvider.maxNumberOfTasks)
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue