Merge branch 'production' into show-all-activity-sessions

This commit is contained in:
ggurdin 2025-12-03 09:58:59 -05:00
commit 34da43a116
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
6 changed files with 34 additions and 24 deletions

View file

@ -196,6 +196,7 @@ abstract class AppConfig {
static String errorSubscriptionId = "pangea_subscription_error";
static double volume = 1.0;
static bool showedActivityMenu = false;
// Pangea#
static void loadFromJson(Map<String, dynamic> json) {

View file

@ -36,6 +36,8 @@ abstract class SettingKeys {
'chat.fluffy.display_navigation_rail';
// #Pangea
static const String volume = 'pangea.volume';
static const String showedActivityMenu =
'pangea.showed_activity_menu_tutorial';
// Pangea#
}

View file

@ -2246,6 +2246,13 @@ class ChatController extends State<ChatPageWithRoom>
bool showActivityDropdown = false;
void setShowDropdown(bool show) async {
if (show && !AppConfig.showedActivityMenu) {
AppConfig.showedActivityMenu = true;
Matrix.of(context).store.setBool(
SettingKeys.showedActivityMenu,
AppConfig.showedActivityMenu,
);
}
setState(() => showActivityDropdown = show);
}

View file

@ -67,37 +67,33 @@ class _ActivityStatsButtonState extends State<ActivityStatsButton> {
Client get _client => widget.controller.room.client;
bool get _shouldShowInstructions {
if (InstructionsEnum.activityStatsMenu.isToggledOff ||
MatrixState.pAnyState.isOverlayOpen(
RegExp(r"^word-zoom-card-.*$"),
) ||
if (AppConfig.showedActivityMenu ||
InstructionsEnum.activityStatsMenu.isToggledOff ||
MatrixState.pAnyState.isOverlayOpen(RegExp(r"^word-zoom-card-.*$")) ||
widget.controller.timeline == null) {
return false;
}
// if someone has finished the activity, enable the tooltip
final userID = Matrix.of(context).client.userID!;
final activityRoles =
widget.controller.room.activityRoles?.roles.values.toList() ?? [];
if (activityRoles.any((r) => r.isFinished)) {
return true;
widget.controller.room.activityRoles?.roles.values ?? [];
final finishedRoles = activityRoles.where((r) => r.isFinished);
if (finishedRoles.isNotEmpty) {
return !finishedRoles.any((r) => r.userId == userID);
}
// otherwise, if no one has finished, only show if the user has sent >= 3 messages
int count = 0;
for (final event in widget.controller.timeline!.events) {
if (event.senderId == _client.userID &&
event.type == EventTypes.Message &&
[
MessageTypes.Text,
MessageTypes.Audio,
].contains(event.messageType)) {
count++;
}
final count = widget.controller.timeline!.events
.where(
(event) =>
event.senderId == userID &&
event.type == EventTypes.Message &&
{MessageTypes.Text, MessageTypes.Audio}
.contains(event.messageType),
)
.length;
if (count >= 3) return true;
}
return false;
return count >= 3;
}
int get _xpCount =>

View file

@ -541,6 +541,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
// #Pangea
AppConfig.volume = store.getDouble(SettingKeys.volume) ?? AppConfig.volume;
AppConfig.showedActivityMenu =
store.getBool(SettingKeys.showedActivityMenu) ??
AppConfig.showedActivityMenu;
// Pangea#
}

View file

@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
# Pangea#
publish_to: none
# On version bump also increase the build number for F-Droid
version: 4.1.15+8
version: 4.1.15+9
environment:
sdk: ">=3.0.0 <4.0.0"