mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Merge remote-tracking branch 'origin/AD-419-decouple-piece-registration-from-' into AD-419-decouple-piece-registration-from-
This commit is contained in:
commit
d069206ca6
@ -14,6 +14,21 @@ class PieceListActions {
|
||||
}
|
||||
|
||||
fetchPieceList(page, pageSize, search, orderBy, orderAsc) {
|
||||
// To prevent flickering on a pagination request,
|
||||
// we overwrite the piecelist with an empty list before
|
||||
// pieceListCount === -1 defines the loading state
|
||||
this.actions.updatePieceList({
|
||||
page,
|
||||
pageSize,
|
||||
search,
|
||||
orderBy,
|
||||
orderAsc,
|
||||
'pieceList': [],
|
||||
'pieceListCount': -1
|
||||
});
|
||||
|
||||
// afterwards, we can load the list
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
PieceListFetcher
|
||||
.fetch(page, pageSize, search, orderBy, orderAsc)
|
||||
|
@ -19,6 +19,7 @@ class PieceListStore {
|
||||
* the number of items the resource actually - without pagination - provides.
|
||||
*/
|
||||
this.pieceList = [];
|
||||
// -1 specifies that the store is currently loading
|
||||
this.pieceListCount = -1;
|
||||
this.page = 1;
|
||||
this.pageSize = 10;
|
||||
|
Loading…
Reference in New Issue
Block a user