fix: in chat details page, reload course info on language update (#4500)

This commit is contained in:
ggurdin 2025-10-22 14:08:57 -04:00 committed by GitHub
parent ab6685ebf7
commit 985fa079b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:collection/collection.dart';
@ -55,11 +57,22 @@ class ChatDetailsController extends State<ChatDetails>
bool loadingActivities = true;
bool loadingCourseSummary = true;
// listen to language updates to refresh course info
StreamSubscription? _languageSubscription;
@override
void initState() {
super.initState();
_loadCourseInfo();
_loadSummaries();
_languageSubscription = MatrixState
.pangeaController.userController.languageStream.stream
.listen((update) {
if (update.prevBaseLang != update.baseLang) {
_loadCourseInfo();
}
});
}
@override
@ -71,6 +84,12 @@ class ChatDetailsController extends State<ChatDetails>
}
}
@override
void dispose() {
_languageSubscription?.cancel();
super.dispose();
}
// Pangea#
bool displaySettings = false;