68346: Fixed loading multiple pages with unloaded inbetween

This commit is contained in:
Kristof De Langhe
2020-02-06 11:43:45 +01:00
parent b987a3d762
commit 210db7fac8

View File

@@ -522,9 +522,14 @@ function addOrderToPages(initialPages: OrderPage[], order: string[], pageSize: n
result.push(orderPage); result.push(orderPage);
} else { } else {
// The page we're trying to add is at least one page ahead of the list, fill the list with empty pages before adding the page. // The page we're trying to add is at least one page ahead of the list, fill the list with empty pages before adding the page.
const emptyOrderPage: OrderPage = { order: [] }; const emptyOrder = [];
emptyOrderPage.order.fill(undefined, 0, pageSize); for (let i = 0; i < pageSize; i++) {
result.fill(emptyOrderPage, result.length, page - 1); emptyOrder.push(undefined);
}
const emptyOrderPage: OrderPage = { order: emptyOrder };
for (let i = result.length; i < page; i++) {
result.push(emptyOrderPage);
}
result.push(orderPage); result.push(orderPage);
} }
return result; return result;