Merge pull request #4847 from pangeachat/4846-course-image-not-showing-up

fix: load course images on course load
This commit is contained in:
ggurdin 2025-12-15 11:36:11 -05:00 committed by GitHub
commit 8d396ef195
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View file

@ -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;

View file

@ -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}";
}