Merge branch 'main' into choreographer-refactor
This commit is contained in:
commit
14621e0963
10 changed files with 62 additions and 33 deletions
|
|
@ -123,9 +123,20 @@ class ChatView extends StatelessWidget {
|
|||
// ),
|
||||
// ];
|
||||
// } else
|
||||
// Pangea#
|
||||
if (!controller.room.isArchived) {
|
||||
// #Pangea
|
||||
// if (!controller.room.isArchived) {
|
||||
// return [
|
||||
// if (AppConfig.experimentalVoip &&
|
||||
// Matrix.of(context).voipPlugin != null &&
|
||||
// controller.room.isDirectChat)
|
||||
// IconButton(
|
||||
// onPressed: controller.onPhoneButtonTap,
|
||||
// icon: const Icon(Icons.call_outlined),
|
||||
// tooltip: L10n.of(context).placeCall,
|
||||
// ),
|
||||
// EncryptionButton(controller.room),
|
||||
// ChatSettingsPopupMenu(controller.room, true),
|
||||
// ];
|
||||
if (!(controller.room.isArchived || controller.room.hasArchivedActivity)) {
|
||||
return [
|
||||
if (controller.room.activityPlan == null ||
|
||||
!controller.room.showActivityChatUI)
|
||||
|
|
@ -148,18 +159,6 @@ class ChatView extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
];
|
||||
// return [
|
||||
// if (AppConfig.experimentalVoip &&
|
||||
// Matrix.of(context).voipPlugin != null &&
|
||||
// controller.room.isDirectChat)
|
||||
// IconButton(
|
||||
// onPressed: controller.onPhoneButtonTap,
|
||||
// icon: const Icon(Icons.call_outlined),
|
||||
// tooltip: L10n.of(context).placeCall,
|
||||
// ),
|
||||
// EncryptionButton(controller.room),
|
||||
// ChatSettingsPopupMenu(controller.room, true),
|
||||
// ];
|
||||
// Pangea#
|
||||
}
|
||||
return [];
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ActivityParticipantIndicator extends StatelessWidget {
|
|||
borderRadius: borderRadius ?? BorderRadius.circular(8.0),
|
||||
color: (hovered || selected) && selectable
|
||||
? theme.colorScheme.surfaceContainerHighest
|
||||
: Colors.transparent,
|
||||
: theme.colorScheme.surface.withAlpha(130),
|
||||
),
|
||||
constraints: const BoxConstraints(maxWidth: 200.0),
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -78,8 +78,10 @@ class _ActivityStatsButtonState extends State<ActivityStatsButton> {
|
|||
// if someone has finished the activity, enable the tooltip
|
||||
final activityRoles =
|
||||
widget.controller.room.activityRoles?.roles.values.toList() ?? [];
|
||||
if (activityRoles.any((r) => r.isFinished)) {
|
||||
return true;
|
||||
final finishedRoles = activityRoles.where((r) => r.isFinished).toList();
|
||||
|
||||
if (finishedRoles.isNotEmpty) {
|
||||
return !finishedRoles.any((r) => r.userId == _client.userID);
|
||||
}
|
||||
|
||||
// otherwise, if no one has finished, only show if the user has sent >= 3 messages
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class ActivityStatsMenuState extends State<ActivityStatsMenu> {
|
|||
),
|
||||
],
|
||||
),
|
||||
if (!room.hasArchivedActivity)
|
||||
if (!userComplete) ...[
|
||||
Text(
|
||||
L10n.of(context).activityDropdownDesc,
|
||||
textAlign: TextAlign.center,
|
||||
|
|
@ -205,7 +205,6 @@ class ActivityStatsMenuState extends State<ActivityStatsMenu> {
|
|||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if (!userComplete) ...[
|
||||
if (shouldShowEndForAll)
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
|
|
|||
|
|
@ -596,7 +596,19 @@ class GetAnalyticsController extends BaseController {
|
|||
final Room? analyticsRoom = _client.analyticsRoomLocal(_l2!);
|
||||
if (analyticsRoom == null) return [];
|
||||
final ids = analyticsRoom.activityRoomIds;
|
||||
return ids.map((id) => _client.getRoomById(id)).whereType<Room>().toList();
|
||||
return ids
|
||||
.map((id) => _client.getRoomById(id))
|
||||
.whereType<Room>()
|
||||
.where(
|
||||
(room) =>
|
||||
room.membership != Membership.leave &&
|
||||
room.membership != Membership.ban,
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
int get archivedActivitiesCount {
|
||||
return archivedActivities.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/client_analytics_extension.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/construct_list_model.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/construct_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/get_analytics_controller.dart';
|
||||
|
|
@ -13,7 +12,6 @@ import 'package:fluffychat/pangea/analytics_summary/learning_progress_bar.dart';
|
|||
import 'package:fluffychat/pangea/analytics_summary/learning_progress_indicator_button.dart';
|
||||
import 'package:fluffychat/pangea/analytics_summary/progress_indicator.dart';
|
||||
import 'package:fluffychat/pangea/analytics_summary/progress_indicators_enum.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/learning_settings/pages/settings_learning.dart';
|
||||
import 'package:fluffychat/widgets/hover_builder.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
|
@ -155,12 +153,8 @@ class LearningProgressIndicatorsState
|
|||
),
|
||||
const SizedBox(width: 6.0),
|
||||
AnimatedFloatingNumber(
|
||||
number: Matrix.of(context)
|
||||
.client
|
||||
.analyticsRoomLocal()
|
||||
?.activityRoomIds
|
||||
.length ??
|
||||
0,
|
||||
number: MatrixState.pangeaController
|
||||
.getAnalytics.archivedActivitiesCount,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ Future<void> showInviteDialog(Room room, BuildContext context) async {
|
|||
);
|
||||
if (joinResult.error != null) return;
|
||||
|
||||
if (room.membership != Membership.join) {
|
||||
await room.client.waitForRoomInSync(room.id, join: true);
|
||||
}
|
||||
|
||||
context.go(
|
||||
room.isSpace ? "/rooms/spaces/${room.id}/details" : "/rooms/${room.id}",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -271,6 +271,7 @@ void chatContextMenuAction(
|
|||
context.go("/rooms");
|
||||
}
|
||||
} else {
|
||||
final parentSpaceId = room.courseParent?.id;
|
||||
final confirmed = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: l10n.areYouSure,
|
||||
|
|
@ -286,8 +287,8 @@ void chatContextMenuAction(
|
|||
);
|
||||
if (!resp.isError) {
|
||||
outerContext.go(
|
||||
room.courseParent != null
|
||||
? "/rooms/spaces/${room.courseParent!.id}/details"
|
||||
parentSpaceId != null
|
||||
? "/rooms/spaces/$parentSpaceId/details"
|
||||
: "/rooms",
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,23 @@ class PangeaController {
|
|||
}
|
||||
|
||||
Future<void> _onLanguageUpdate(LanguageUpdate update) async {
|
||||
clearCache(exclude: ["analytics_storage"]);
|
||||
final exclude = [
|
||||
'analytics_storage',
|
||||
'course_location_media_storage',
|
||||
'course_location_storage',
|
||||
'course_media_storage',
|
||||
];
|
||||
|
||||
// only clear course data if the base language has changed
|
||||
if (update.prevBaseLang == update.baseLang) {
|
||||
exclude.addAll([
|
||||
'course_storage',
|
||||
'course_topic_storage',
|
||||
'course_activity_storage',
|
||||
]);
|
||||
}
|
||||
|
||||
clearCache(exclude: exclude);
|
||||
_updateBotOptions();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,9 @@ class TokensUtil {
|
|||
static List<PangeaTokenText> getNewTokens(
|
||||
PangeaMessageEvent event,
|
||||
) {
|
||||
if (!event.eventId.isValidMatrixId) {
|
||||
if (!event.eventId.isValidMatrixId ||
|
||||
(MatrixState.pangeaController.subscriptionController.isSubscribed ==
|
||||
false)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue