🐛 Bug fixes on notification push token register

This commit is contained in:
LittleSheep 2024-11-23 12:52:13 +08:00
parent e70041fefa
commit 63499df99f
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@ class NotificationProvider extends ChangeNotifier {
if (!_ua.isAuthorized) return; if (!_ua.isAuthorized) return;
log("Registering push notifications..."); log("Registering push notifications...");
await registerPushNotifications(); await registerPushNotifications();
log("Registered push notification subscriber successfully!");
}); });
} }
@ -54,7 +55,7 @@ class NotificationProvider extends ChangeNotifier {
log('Device Push Token is $token'); log('Device Push Token is $token');
await _sn.client.post( await _sn.client.post(
'/cgi/id/notifications/subscribe', '/cgi/id/notifications/subscription',
data: { data: {
'provider': provider, 'provider': provider,
'device_token': token, 'device_token': token,

View File

@ -275,6 +275,8 @@ class ChatMessageInputState extends State<ChatMessageInput> {
]), ]),
border: InputBorder.none, border: InputBorder.none,
), ),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: (_) { onSubmitted: (_) {
if (_isBusy) return; if (_isBusy) return;
_sendMessage(); _sendMessage();