Merge pull request #378 from pangeachat/prevent-analytics-reload

prevent auto-reload of analytics page when resizing screen, also reso…
This commit is contained in:
ggurdin 2024-06-24 10:28:31 -04:00 committed by GitHub
commit 929843248c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);