MOBILE-3833 feedback: Fix attempts pagination
parent
22c482bdda
commit
02c2a5e508
|
@ -135,8 +135,14 @@ export class AddonModFeedbackAttemptsSource extends CoreRoutedItemsManagerSource
|
||||||
|
|
||||||
const totalItemsLoaded = this.getPageLength() * (page + 1);
|
const totalItemsLoaded = this.getPageLength() * (page + 1);
|
||||||
const pageAttempts: AddonModFeedbackAttemptItem[] = [
|
const pageAttempts: AddonModFeedbackAttemptItem[] = [
|
||||||
...result.attempts,
|
// The page argument is ignored in the webservice when there is only one page,
|
||||||
...result.anonattempts,
|
// so we should ignore the responses of pages beyond the first if that's the case.
|
||||||
|
...(page === 0 || result.totalattempts > AddonModFeedbackProvider.PER_PAGE)
|
||||||
|
? result.attempts
|
||||||
|
: [],
|
||||||
|
...(page === 0 || result.totalanonattempts > AddonModFeedbackProvider.PER_PAGE)
|
||||||
|
? result.anonattempts
|
||||||
|
: [],
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue