diff --git a/lib/providers/websocket.dart b/lib/providers/websocket.dart index 8d62406..914ea32 100644 --- a/lib/providers/websocket.dart +++ b/lib/providers/websocket.dart @@ -152,6 +152,8 @@ class WebSocketProvider extends GetxController { } Future registerPushNotifications() async { + if (PlatformInfo.isWeb) return; + final prefs = await SharedPreferences.getInstance(); if (prefs.getBool('service_background_notification') == true) { log('Background notification service has been enabled, skip register push notifications'); diff --git a/lib/widgets/attachments/attachment_editor.dart b/lib/widgets/attachments/attachment_editor.dart index f8eb736..bedab02 100644 --- a/lib/widgets/attachments/attachment_editor.dart +++ b/lib/widgets/attachments/attachment_editor.dart @@ -312,7 +312,9 @@ class _AttachmentEditorPopupState extends State { } Widget _buildQueueEntry(AttachmentUploadTask element, int index) { - final extName = extension(element.file.path).substring(1); + final extName = element.file.name.contains('.') + ? extension(element.file.name).substring(1) + : ''; final canBeCrop = ['png', 'jpg', 'jpeg', 'gif'].contains(extName); return Container(