prevent auto-reload of analytics page when resizing screen, also resolved concurrent list modification error

This commit is contained in:
ggurdin 2024-06-24 10:27:51 -04:00
parent 27504ee6af
commit 8b5b9a96dc
2 changed files with 5 additions and 14 deletions

View file

@ -220,11 +220,7 @@ abstract class AppRoutes {
pageBuilder: (context, state) => defaultPageBuilder(
context,
state,
ClassAnalyticsPage(
// when going to sub-space from within a parent space's analytics, the
// analytics list tiles do not properly update. Adding a unique key to this page is the best fix
// I can find at the moment
key: UniqueKey(),
const ClassAnalyticsPage(
selectedView: BarChartViewSelection.messages,
),
),
@ -234,11 +230,7 @@ abstract class AppRoutes {
pageBuilder: (context, state) => defaultPageBuilder(
context,
state,
ClassAnalyticsPage(
// when going to sub-space from within a parent space's analytics, the
// analytics list tiles do not properly update. Adding a unique key to this page is the best fix
// I can find at the moment
key: UniqueKey(),
const ClassAnalyticsPage(
selectedView: BarChartViewSelection.grammar,
),
),

View file

@ -34,12 +34,11 @@ class ClassController extends BaseController {
Future<void> fixClassPowerLevels() async {
try {
final List<Future<void>> classFixes = [];
final teacherSpaces = await _pangeaController
.matrixState.client.classesAndExchangesImTeaching;
for (final room in teacherSpaces) {
classFixes.add(room.setClassPowerLevels());
}
final List<Future<void>> classFixes = List<Room>.from(teacherSpaces)
.map((adminSpace) => adminSpace.setClassPowerLevels())
.toList();
await Future.wait(classFixes);
} catch (err, stack) {
debugger(when: kDebugMode);