mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-05 19:49:29 +01:00
fix: Display error when user tries to send too large file
This commit is contained in:
parent
78a5206ba7
commit
a76ea48d84
@ -2518,5 +2518,6 @@
|
||||
"enterInviteLinkOrMatrixId": "Enter invite link or Matrix ID...",
|
||||
"reopenChat": "Reopen chat",
|
||||
"noBackupWarning": "Warning! Without enabling chat backup, you will lose access to your encrypted messages. It is highly recommended to enable the chat backup first before logging out.",
|
||||
"noOtherDevicesFound": "No other devices found"
|
||||
"noOtherDevicesFound": "No other devices found",
|
||||
"fileIsTooBigForServer": "The server reports that the file is too large to be sent."
|
||||
}
|
@ -446,6 +446,7 @@ class ChatController extends State<Chat> {
|
||||
}
|
||||
|
||||
void voiceMessageAction() async {
|
||||
final scaffoldMessenger = ScaffoldMessenger.of(context);
|
||||
if (PlatformInfos.isAndroid) {
|
||||
final info = await DeviceInfoPlugin().androidInfo;
|
||||
if (info.version.sdkInt < 19) {
|
||||
@ -486,7 +487,16 @@ class ChatController extends State<Chat> {
|
||||
'waveform': result.waveform,
|
||||
},
|
||||
},
|
||||
);
|
||||
).catchError((e) {
|
||||
scaffoldMessenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
(e as Object).toLocalizedString(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
return null;
|
||||
});
|
||||
setState(() {
|
||||
replyEvent = null;
|
||||
});
|
||||
|
@ -4,6 +4,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/utils/localized_exception_extension.dart';
|
||||
import 'package:fluffychat/utils/size_string.dart';
|
||||
import '../../utils/resize_image.dart';
|
||||
|
||||
@ -47,7 +48,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||
)
|
||||
.catchError((e) {
|
||||
scaffoldMessenger.showSnackBar(
|
||||
SnackBar(content: Text(e.toLocalizedString())),
|
||||
SnackBar(content: Text((e as Object).toLocalizedString(context))),
|
||||
);
|
||||
return null;
|
||||
});
|
||||
|
@ -19,6 +19,9 @@ extension LocalizedExceptionExtension on Object {
|
||||
return (this as MatrixException).errorMessage;
|
||||
}
|
||||
}
|
||||
if (this is FileTooBigMatrixException) {
|
||||
return L10n.of(context)!.fileIsTooBigForServer;
|
||||
}
|
||||
if (this is BadServerVersionsException) {
|
||||
final serverVersions = (this as BadServerVersionsException)
|
||||
.serverVersions
|
||||
|
Loading…
Reference in New Issue
Block a user