🐛 Bug fixes and optimization
This commit is contained in:
@ -54,7 +54,7 @@ class AccountProvider extends GetxController {
|
||||
}
|
||||
|
||||
final AuthProvider auth = Get.find();
|
||||
auth.ensureCredentials();
|
||||
await auth.ensureCredentials();
|
||||
|
||||
if (auth.credentials == null) await auth.loadCredentials();
|
||||
|
||||
@ -185,7 +185,7 @@ class AccountProvider extends GetxController {
|
||||
late final String provider;
|
||||
final deviceUuid = await _getDeviceUuid();
|
||||
|
||||
if (deviceUuid == null) {
|
||||
if (deviceUuid == null || deviceUuid.isEmpty) {
|
||||
log("Unable to active push notifications, couldn't get device uuid");
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class ChatProvider extends GetxController {
|
||||
}
|
||||
|
||||
final AuthProvider auth = Get.find();
|
||||
auth.ensureCredentials();
|
||||
await auth.ensureCredentials();
|
||||
|
||||
final uri = Uri.parse(
|
||||
'${ServiceFinder.services['messaging']}/api/ws?tk=${auth.credentials!.accessToken}'
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -81,8 +81,8 @@ class _ChannelDetailScreenState extends State<ChannelDetailScreen> {
|
||||
|
||||
final client = auth.configureClient(service: 'messaging');
|
||||
|
||||
final resp = await client
|
||||
.put('/api/channels/${widget.realm}/${widget.channel.alias}/members/me', {
|
||||
final resp = await client.put(
|
||||
'/api/channels/${widget.realm}/${widget.channel.alias}/members/me', {
|
||||
'nick': null,
|
||||
'notify_level': _notifyLevel,
|
||||
});
|
||||
@ -112,14 +112,17 @@ class _ChannelDetailScreenState extends State<ChannelDetailScreen> {
|
||||
|
||||
final ownerActions = [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.edit),
|
||||
leading: const Icon(Icons.settings),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
title: Text('channelAdjust'.tr.capitalize!),
|
||||
title: Text('channelSettings'.tr.capitalize!),
|
||||
onTap: () async {
|
||||
AppRouter.instance
|
||||
.pushNamed(
|
||||
'channelOrganizing',
|
||||
extra: ChannelOrganizeArguments(edit: widget.channel),
|
||||
extra: ChannelOrganizeArguments(
|
||||
edit: widget.channel,
|
||||
realm: widget.channel.realm,
|
||||
),
|
||||
)
|
||||
.then((resp) {
|
||||
if (resp != null) {
|
||||
@ -176,7 +179,7 @@ class _ChannelDetailScreenState extends State<ChannelDetailScreen> {
|
||||
isExpanded: true,
|
||||
items: notifyTypes.entries
|
||||
.map((item) => DropdownMenuItem<int>(
|
||||
enabled: !_isBusy,
|
||||
enabled: !_isBusy,
|
||||
value: item.key,
|
||||
child: Text(
|
||||
item.value,
|
||||
|
@ -132,7 +132,7 @@ class _ChannelOrganizeScreenState extends State<ChannelOrganizeScreen> {
|
||||
),
|
||||
actions: notifyBannerActions,
|
||||
).paddingOnly(bottom: 6),
|
||||
if (widget.realm != null)
|
||||
if (widget.realm != null && widget.edit == null)
|
||||
MaterialBanner(
|
||||
leading: const Icon(Icons.group),
|
||||
leadingPadding: const EdgeInsets.only(left: 10, right: 20),
|
||||
|
@ -67,9 +67,9 @@ class _RealmDetailScreenState extends State<RealmDetailScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
final ownerActions = [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.edit),
|
||||
leading: const Icon(Icons.settings),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
title: Text('realmAdjust'.tr.capitalize!),
|
||||
title: Text('realmSettings'.tr.capitalize!),
|
||||
onTap: () async {
|
||||
AppRouter.instance
|
||||
.pushNamed(
|
||||
@ -119,11 +119,6 @@ class _RealmDetailScreenState extends State<RealmDetailScreen> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.settings),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
title: Text('realmSettings'.tr.capitalize!),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.supervisor_account),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
|
@ -94,7 +94,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
getMetadataList();
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,17 @@ class ChatMessage extends StatelessWidget {
|
||||
if (isContentPreviewing) {
|
||||
widget = buildContent();
|
||||
} else if (isMerged) {
|
||||
widget = buildContent().paddingOnly(left: 52);
|
||||
widget = Column(
|
||||
children: [
|
||||
buildContent().paddingOnly(left: 52),
|
||||
if (item.attachments?.isNotEmpty ?? false)
|
||||
AttachmentList(
|
||||
key: Key('m${item.uuid}attachments'),
|
||||
parentId: item.uuid,
|
||||
attachmentsId: item.attachments ?? List.empty(),
|
||||
).paddingSymmetric(vertical: 4),
|
||||
],
|
||||
);
|
||||
} else if (isReply) {
|
||||
widget = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -149,6 +159,7 @@ class ChatMessage extends StatelessWidget {
|
||||
).paddingSymmetric(horizontal: 12),
|
||||
if (item.attachments?.isNotEmpty ?? false)
|
||||
AttachmentList(
|
||||
key: Key('m${item.uuid}attachments'),
|
||||
parentId: item.uuid,
|
||||
attachmentsId: item.attachments ?? List.empty(),
|
||||
).paddingSymmetric(vertical: 4),
|
||||
|
@ -75,7 +75,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
||||
'uuid': const Uuid().v4(),
|
||||
'type': 'm.text',
|
||||
'content': encodeMessage(_textController.value.text),
|
||||
'attachments': _attachments,
|
||||
'attachments': List.from(_attachments),
|
||||
'reply_to': _replyTo?.id,
|
||||
};
|
||||
|
||||
@ -96,6 +96,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
||||
updatedAt: DateTime.now(),
|
||||
content: payload['content'] as Map<String, dynamic>,
|
||||
type: payload['type'] as String,
|
||||
attachments: _attachments,
|
||||
sender: sender,
|
||||
replyId: _replyTo?.id,
|
||||
replyTo: _replyTo,
|
||||
|
Reference in New Issue
Block a user