🐛 Fix several known bugs

This commit is contained in:
2024-05-08 22:01:06 +08:00
parent a4f8c65aa5
commit c1d3bac0c8
27 changed files with 88 additions and 61 deletions

View File

@ -132,7 +132,7 @@ class _ChatCallState extends State<ChatCall> {
title: AppLocalizations.of(context)!.chatCall,
fixedAppBarColor: SolianTheme.isLargeScreen(context),
hideDrawer: true,
child: content,
body: content,
);
}

View File

@ -102,6 +102,7 @@ class _ChannelEditorScreenState extends State<ChannelEditorScreen> {
return IndentScaffold(
hideDrawer: true,
showSafeArea: true,
title: AppLocalizations.of(context)!.chatChannelOrganize,
appBarActions: <Widget>[
TextButton(
@ -109,7 +110,7 @@ class _ChannelEditorScreenState extends State<ChannelEditorScreen> {
child: Text(AppLocalizations.of(context)!.apply.toUpperCase()),
),
],
child: Column(
body: Column(
children: [
_isSubmitting ? const LinearProgressIndicator().animate().scaleX() : Container(),
widget.editing != null ? editingBanner : Container(),

View File

@ -38,6 +38,7 @@ class _ChatMemberScreenState extends State<ChatMemberScreen> {
_selfId = prof['id'];
var uri = getRequestUri('messaging', '/api/channels/${widget.realm}/${widget.channel.alias}/members');
print(uri);
var res = await auth.client!.get(uri);
if (res.statusCode == 200) {
@ -141,7 +142,6 @@ class _ChatMemberScreenState extends State<ChatMemberScreen> {
Widget build(BuildContext context) {
return IndentScaffold(
title: AppLocalizations.of(context)!.chatMember,
noSafeArea: true,
hideDrawer: true,
appBarActions: [
IconButton(
@ -149,7 +149,7 @@ class _ChatMemberScreenState extends State<ChatMemberScreen> {
onPressed: () => promptAddMember(),
),
],
child: RefreshIndicator(
body: RefreshIndicator(
onRefresh: () => fetchMemberships(),
child: CustomScrollView(
slivers: [

View File

@ -32,6 +32,7 @@ class ChatScreen extends StatelessWidget {
return IndentScaffold(
title: chat.focusChannel?.name ?? 'Loading...',
hideDrawer: true,
showSafeArea: true,
fixedAppBarColor: SolianTheme.isLargeScreen(context),
appBarActions: chat.focusChannel != null
? [
@ -48,7 +49,7 @@ class ChatScreen extends StatelessWidget {
),
]
: [],
child: ChatWidget(
body: ChatWidget(
alias: alias,
realm: realm,
),
@ -96,7 +97,7 @@ class _ChatWidgetState extends State<ChatWidget> {
if (a?.replyTo != null) return false;
if (a == null || b == null) return false;
if (a.senderId != b.senderId) return false;
return a.createdAt.difference(b.createdAt).inMinutes <= 5;
return a.createdAt.difference(b.createdAt).inMinutes <= 3;
}
Message? _editingItem;
@ -107,6 +108,7 @@ class _ChatWidgetState extends State<ChatWidget> {
context: context,
builder: (context) => ChatMessageAction(
channel: widget.alias,
realm: widget.realm,
item: item,
onEdit: () => setState(() {
_editingItem = item;

View File

@ -67,8 +67,7 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
return IndentScaffold(
title: AppLocalizations.of(context)!.chatDetail,
hideDrawer: true,
noSafeArea: true,
child: Column(
body: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
@ -103,9 +102,12 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
title: Text(AppLocalizations.of(context)!.chatMember),
onTap: () {
SolianRouter.router.pushNamed(
'chat.channel.member',
widget.realm == 'global' ? 'chat.channel.member' : 'realms.chat.channel.member',
extra: widget.channel,
pathParameters: {'channel': widget.channel.alias},
pathParameters: {
'channel': widget.channel.alias,
...(widget.realm == 'global' ? {} : {'realm': widget.realm}),
},
);
},
),

View File

@ -24,7 +24,7 @@ class ChatListScreen extends StatelessWidget {
title: AppLocalizations.of(context)!.chat,
appBarActions: const [NotificationButton()],
fixedAppBarColor: SolianTheme.isLargeScreen(context),
child: const ChatListWidget(),
body: const ChatListWidget(),
);
}
}