feat: store whether or not user has seen activity menu tutorial popup and don't show it again
This commit is contained in:
parent
67b19d722a
commit
3f1d489ec0
5 changed files with 19 additions and 1 deletions
|
|
@ -196,6 +196,7 @@ abstract class AppConfig {
|
|||
static String errorSubscriptionId = "pangea_subscription_error";
|
||||
|
||||
static double volume = 1.0;
|
||||
static bool showedActivityMenuTutorial = false;
|
||||
// Pangea#
|
||||
|
||||
static void loadFromJson(Map<String, dynamic> json) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ abstract class SettingKeys {
|
|||
'chat.fluffy.display_navigation_rail';
|
||||
// #Pangea
|
||||
static const String volume = 'pangea.volume';
|
||||
static const String showedActivityMenuTutorial =
|
||||
'pangea.showed_activity_menu_tutorial';
|
||||
// Pangea#
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat/chat.dart';
|
||||
import 'package:fluffychat/pangea/activity_sessions/activity_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/instructions/instructions_enum.dart';
|
||||
|
|
@ -7,7 +8,8 @@ import 'package:fluffychat/widgets/matrix.dart';
|
|||
|
||||
extension ActivityMenuLogic on ChatController {
|
||||
bool get shouldShowActivityInstructions {
|
||||
if (InstructionsEnum.activityStatsMenu.isToggledOff ||
|
||||
if (AppConfig.showedActivityMenuTutorial ||
|
||||
InstructionsEnum.activityStatsMenu.isToggledOff ||
|
||||
MatrixState.pAnyState.isOverlayOpen(RegExp(r"^word-zoom-card-.*$")) ||
|
||||
timeline == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pages/chat/chat.dart';
|
||||
import 'package:fluffychat/pangea/activity_sessions/activity_session_chat/activity_chat_extension.dart';
|
||||
|
|
@ -12,6 +13,7 @@ import 'package:fluffychat/pangea/common/utils/overlay.dart';
|
|||
import 'package:fluffychat/pangea/common/widgets/tutorial_overlay_message.dart';
|
||||
import 'package:fluffychat/pangea/events/constants/pangea_event_types.dart';
|
||||
import 'package:fluffychat/pangea/instructions/instructions_enum.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
class ActivityMenuButton extends StatefulWidget {
|
||||
final ChatController controller;
|
||||
|
|
@ -87,6 +89,13 @@ class _ActivityMenuButtonState extends State<ActivityMenuButton> {
|
|||
widget.controller.toggleShowDropdown();
|
||||
},
|
||||
);
|
||||
|
||||
AppConfig.showedActivityMenuTutorial = true;
|
||||
Matrix.of(context).store.setBool(
|
||||
SettingKeys.showedActivityMenuTutorial,
|
||||
AppConfig.showedActivityMenuTutorial,
|
||||
);
|
||||
|
||||
setState(() => _showShimmer = true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -548,6 +548,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
|
||||
// #Pangea
|
||||
AppConfig.volume = store.getDouble(SettingKeys.volume) ?? AppConfig.volume;
|
||||
|
||||
AppConfig.showedActivityMenuTutorial =
|
||||
store.getBool(SettingKeys.showedActivityMenuTutorial) ??
|
||||
AppConfig.showedActivityMenuTutorial;
|
||||
// Pangea#
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue