MOBILE-4362 rating: Trim not trimmed versions

main
Pau Ferrer Ocaña 2023-10-25 15:02:24 +02:00
parent 79300ba408
commit 993dc19a85
1 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ export class CoreRatingProvider {
const response = await site.read<CoreRatingGetItemRatingsWSResponse>('core_rating_get_item_ratings', params, preSets); const response = await site.read<CoreRatingGetItemRatingsWSResponse>('core_rating_get_item_ratings', params, preSets);
if (!site.isVersionGreaterEqualThan([' 3.6.5', '3.7.1', '3.8'])) { if (!site.isVersionGreaterEqualThan(['3.6.5', '3.7.1', '3.8'])) {
// MDL-65042 We need to fetch profiles because the returned profile pictures are incorrect. // MDL-65042 We need to fetch profiles because the returned profile pictures are incorrect.
const promises = response.ratings.map((rating: CoreRatingItemRating) => const promises = response.ratings.map((rating: CoreRatingItemRating) =>
CoreUser.getProfile(rating.userid, courseId, true, site.id).then((user) => { CoreUser.getProfile(rating.userid, courseId, true, site.id).then((user) => {
@ -407,7 +407,7 @@ export class CoreRatingProvider {
const ratingsResults = await Promise.all(promises); const ratingsResults = await Promise.all(promises);
if (!site.isVersionGreaterEqualThan([' 3.6.5', '3.7.1', '3.8'])) { if (!site.isVersionGreaterEqualThan(['3.6.5', '3.7.1', '3.8'])) {
const ratings: CoreRatingItemRating[] = [].concat.apply([], ratingsResults); const ratings: CoreRatingItemRating[] = [].concat.apply([], ratingsResults);
const userIds = ratings.map((rating) => rating.userid); const userIds = ratings.map((rating) => rating.userid);