Merge pull request #4847 from pangeachat/4846-course-image-not-showing-up
fix: load course images on course load
This commit is contained in:
commit
8d396ef195
2 changed files with 3 additions and 6 deletions
|
|
@ -46,6 +46,7 @@ mixin CoursePlanProvider<T extends StatefulWidget> on State<T> {
|
|||
l1: MatrixState.pangeaController.userController.userL1Code!,
|
||||
),
|
||||
);
|
||||
await course!.fetchMediaUrls();
|
||||
} catch (e) {
|
||||
courseError = e;
|
||||
} finally {
|
||||
|
|
@ -64,11 +65,7 @@ mixin CoursePlanProvider<T extends StatefulWidget> on State<T> {
|
|||
throw Exception("Course is null");
|
||||
}
|
||||
|
||||
final courseFutures = <Future>[
|
||||
course!.fetchMediaUrls(),
|
||||
course!.fetchTopics(),
|
||||
];
|
||||
await Future.wait(courseFutures);
|
||||
await course!.fetchTopics();
|
||||
await _loadTopicsMedia();
|
||||
} catch (e) {
|
||||
topicError = e;
|
||||
|
|
|
|||
|
|
@ -131,5 +131,5 @@ class CoursePlanModel {
|
|||
? loadedTopics.values
|
||||
.lastWhereOrNull((topic) => topic.imageUrl != null)
|
||||
?.imageUrl
|
||||
: "${Environment.cmsApi}${loadedMediaUrls.mediaUrls.first}";
|
||||
: "${Environment.cmsApi}${loadedMediaUrls.mediaUrls.first.url}";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue