Skip to content

Commit

Permalink
Merge pull request #378 from pangeachat/prevent-analytics-reload
Browse files Browse the repository at this point in the history
prevent auto-reload of analytics page when resizing screen, also reso…
  • Loading branch information
ggurdin authored Jun 24, 2024
2 parents 27504ee + 8b5b9a9 commit 9298432
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
12 changes: 2 additions & 10 deletions lib/config/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
Expand All @@ -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,
),
),
Expand Down
7 changes: 3 additions & 4 deletions lib/pangea/controllers/class_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9298432

Please sign in to comment.