Merge branch 'shine/send-file-multiple-event-send-fix' into 'main'
fix: send file dialog - prevent multiple file sending See merge request ChristianPauly/fluffychat-flutter!242
This commit is contained in:
commit
d74c3e2187
|
@ -19,7 +19,7 @@ class SendFileDialog extends StatefulWidget {
|
|||
|
||||
class _SendFileDialogState extends State<SendFileDialog> {
|
||||
bool origImage = false;
|
||||
|
||||
bool _isSending = false;
|
||||
Future<void> _send() async {
|
||||
var file = widget.file;
|
||||
if (file is MatrixImageFile && !origImage) {
|
||||
|
@ -82,8 +82,14 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||
),
|
||||
FlatButton(
|
||||
child: Text(L10n.of(context).send),
|
||||
onPressed: () async {
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(_send());
|
||||
onPressed: _isSending
|
||||
? null
|
||||
: () async {
|
||||
setState(() {
|
||||
_isSending = true;
|
||||
});
|
||||
await SimpleDialogs(context)
|
||||
.tryRequestWithLoadingDialog(_send());
|
||||
await Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue