chore: set active filter to groups after creating new group (#1990)
This commit is contained in:
parent
0c9a44a26e
commit
acb0ced1b0
3 changed files with 19 additions and 6 deletions
|
|
@ -43,6 +43,7 @@ import '../../widgets/matrix.dart';
|
|||
import 'package:fluffychat/utils/tor_stub.dart'
|
||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
||||
|
||||
|
||||
enum PopupMenuAction {
|
||||
settings,
|
||||
invite,
|
||||
|
|
@ -474,13 +475,15 @@ class ChatListController extends State<ChatList>
|
|||
//#Pangea
|
||||
classStream = MatrixState.pangeaController.classController.stateStream
|
||||
.listen((event) {
|
||||
if (mounted) {
|
||||
event["activeSpaceId"] != null
|
||||
? setActiveSpace(event["activeSpaceId"])
|
||||
: clearActiveSpace();
|
||||
if (event["activeSpaceId"] != null) {
|
||||
context.push("/rooms/${event["activeSpaceId"]}/details");
|
||||
if (!mounted || event is! Map<String, dynamic>) return;
|
||||
if (event.containsKey("activeSpaceId")) {
|
||||
final setSpaceID = event["activeSpaceId"];
|
||||
setSpaceID != null ? setActiveSpace(setSpaceID) : clearActiveSpace();
|
||||
if (setSpaceID != null) {
|
||||
context.push("/rooms/$setSpaceID/details");
|
||||
}
|
||||
} else if (event.containsKey("activeFilter")) {
|
||||
setActiveFilter(event["activeFilter"]);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:matrix/matrix.dart' as sdk;
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/new_group/new_group_view.dart';
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/common/constants/model_keys.dart';
|
||||
|
|
@ -107,6 +108,10 @@ class NewGroupController extends State<NewGroup> {
|
|||
// if a timeout happened, don't redirect to the chat
|
||||
if (error != null) return;
|
||||
// Pangea#
|
||||
MatrixState.pangeaController.classController
|
||||
.setActiveFilterInChatListController(
|
||||
AppConfig.separateChatTypes ? ActiveFilter.groups : ActiveFilter.allChats,
|
||||
);
|
||||
context.go('/rooms/$roomId/invite');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:get_storage/get_storage.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pangea/common/constants/local.key.dart';
|
||||
import 'package:fluffychat/pangea/common/controllers/pangea_controller.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
|
|
@ -28,6 +29,10 @@ class ClassController extends BaseController {
|
|||
_pangeaController = pangeaController;
|
||||
}
|
||||
|
||||
void setActiveFilterInChatListController(ActiveFilter filter) {
|
||||
setState({"activeFilter": filter});
|
||||
}
|
||||
|
||||
void setActiveSpaceIdInChatListController(String? classId) {
|
||||
setState({"activeSpaceId": classId});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue