🐛 Bug fixes and optimization

This commit is contained in:
LittleSheep 2024-08-23 23:16:41 +08:00
parent a70e6c7118
commit 14e8f7b775
4 changed files with 6 additions and 8 deletions

View File

@ -149,7 +149,7 @@ class WebSocketProvider extends GetxController {
'device_token': token, 'device_token': token,
'device_id': deviceUuid, 'device_id': deviceUuid,
}); });
if (resp.statusCode != 200) { if (resp.statusCode != 200 && resp.statusCode != 400) {
throw RequestException(resp); throw RequestException(resp);
} }
} }

View File

@ -104,8 +104,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
setState(() => _isBusy = false); setState(() => _isBusy = false);
} }
List<ChannelMember> _typingUsers = List.empty(growable: true); final List<ChannelMember> _typingUsers = List.empty(growable: true);
Map<int, Timer> _typingInactiveTimer = {}; final Map<int, Timer> _typingInactiveTimer = {};
void _listenMessages() { void _listenMessages() {
final WebSocketProvider ws = Get.find(); final WebSocketProvider ws = Get.find();
@ -133,6 +133,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
case 'status.typing': case 'status.typing':
if (event.payload?['channel_id'] != _channel!.id) break; if (event.payload?['channel_id'] != _channel!.id) break;
final member = ChannelMember.fromJson(event.payload!['member']); final member = ChannelMember.fromJson(event.payload!['member']);
if (member.id == _channelProfile!.id) break;
if (!_typingUsers.any((x) => x.id == member.id)) { if (!_typingUsers.any((x) => x.id == member.id)) {
setState(() { setState(() {
_typingUsers.add(member); _typingUsers.add(member);

View File

@ -197,10 +197,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
} else if (SolianTheme.isLargeScreen(context)) { } else if (SolianTheme.isLargeScreen(context)) {
_collapseDrawer(); _collapseDrawer();
} else { } else {
_drawerAnimationController.animateTo( _drawerAnimationController.value = 1;
1,
duration: const Duration(milliseconds: 100),
);
} }
} }

View File

@ -2,7 +2,7 @@ name: solian
description: "The Solar Network App" description: "The Solar Network App"
publish_to: "none" publish_to: "none"
version: 1.2.1+22 version: 1.2.1+23
environment: environment:
sdk: ">=3.3.4 <4.0.0" sdk: ">=3.3.4 <4.0.0"