update space list on update analytics
This commit is contained in:
parent
91f5fab0ea
commit
e4357a3e9b
3 changed files with 8 additions and 5 deletions
|
|
@ -245,7 +245,6 @@ class MyAnalyticsController extends BaseController {
|
|||
List<Room> _studentSpaces = [];
|
||||
|
||||
Future<void> setStudentSpaces() async {
|
||||
if (_studentSpaces.isNotEmpty) return;
|
||||
_studentSpaces = await _pangeaController
|
||||
.matrixState.client.classesAndExchangesImStudyingIn;
|
||||
}
|
||||
|
|
@ -284,6 +283,7 @@ class MyAnalyticsController extends BaseController {
|
|||
|
||||
Future<void> updateAnalytics() async {
|
||||
await setStudentChats();
|
||||
await setStudentSpaces();
|
||||
final List<Room> analyticsRooms =
|
||||
_pangeaController.matrixState.client.allMyAnalyticsRooms;
|
||||
analyticsRooms.addAll(await createMissingAnalyticsRoom());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,13 @@ extension ClassesAndExchangesClientExtension on Client {
|
|||
.toList();
|
||||
|
||||
Future<List<Room>> get _classesAndExchangesImStudyingIn async {
|
||||
for (final Room space in rooms.where((room) => room.isSpace)) {
|
||||
final List<Room> joinedSpaces = rooms
|
||||
.where(
|
||||
(room) => room.isSpace && room.membership == Membership.join,
|
||||
)
|
||||
.toList();
|
||||
|
||||
for (final Room space in joinedSpaces) {
|
||||
if (space.getState(EventTypes.RoomPowerLevels) == null) {
|
||||
await space.postLoad();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,9 +278,6 @@ class ConstructListViewState extends State<ConstructListView> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint(
|
||||
"constructs lengths: ${constructs?.map((x) => '${x.lemma}: ${x.uses.length}').toList()}",
|
||||
);
|
||||
if (!widget.init || fetchingUses) {
|
||||
return const Expanded(
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue