mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
chore: Improve stories
This commit is contained in:
parent
48a5c52a94
commit
fb856930ef
@ -136,7 +136,10 @@ class StoryPageController extends State<StoryPage> {
|
|||||||
Future<void>? loadStory;
|
Future<void>? loadStory;
|
||||||
|
|
||||||
Future<void> _loadStory() async {
|
Future<void> _loadStory() async {
|
||||||
final room = Matrix.of(context).client.getRoomById(roomId);
|
final client = Matrix.of(context).client;
|
||||||
|
await client.roomsLoading;
|
||||||
|
await client.accountDataLoading;
|
||||||
|
final room = client.getRoomById(roomId);
|
||||||
if (room == null) return;
|
if (room == null) return;
|
||||||
if (room.membership != Membership.join) {
|
if (room.membership != Membership.join) {
|
||||||
final joinedFuture = room.client.onSync.stream
|
final joinedFuture = room.client.onSync.stream
|
||||||
|
@ -23,6 +23,7 @@ class StoryView extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final currentEvent = controller.currentEvent;
|
final currentEvent = controller.currentEvent;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.blueGrey,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: ListTile(
|
title: ListTile(
|
||||||
|
@ -33,6 +33,7 @@ import 'package:matrix/matrix.dart';
|
|||||||
import 'package:unifiedpush/unifiedpush.dart' hide Message;
|
import 'package:unifiedpush/unifiedpush.dart' hide Message;
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/client_stories_extension.dart';
|
||||||
import '../config/app_config.dart';
|
import '../config/app_config.dart';
|
||||||
import '../config/setting_keys.dart';
|
import '../config/setting_keys.dart';
|
||||||
import 'famedlysdk_store.dart';
|
import 'famedlysdk_store.dart';
|
||||||
@ -296,7 +297,13 @@ class BackgroundPush {
|
|||||||
if (router == null) {
|
if (router == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.currentState.toSegments(['rooms', roomId]);
|
final isStory = client
|
||||||
|
?.getRoomById(roomId)
|
||||||
|
?.getState(EventTypes.RoomCreate)
|
||||||
|
?.content
|
||||||
|
?.tryGet<String>('type') ==
|
||||||
|
ClientStoriesExtension.storiesRoomType;
|
||||||
|
router.currentState.toSegments([isStory ? 'stories' : 'rooms', roomId]);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logs().e('[Push] Failed to open room', e, s);
|
Logs().e('[Push] Failed to open room', e, s);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user