mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
fix: send file dialog - prevent multiple file sending
This commit is contained in:
parent
c7f8a9319b
commit
941b211e63
@ -19,7 +19,7 @@ class SendFileDialog extends StatefulWidget {
|
|||||||
|
|
||||||
class _SendFileDialogState extends State<SendFileDialog> {
|
class _SendFileDialogState extends State<SendFileDialog> {
|
||||||
bool origImage = false;
|
bool origImage = false;
|
||||||
|
bool _isSending = false;
|
||||||
Future<void> _send() async {
|
Future<void> _send() async {
|
||||||
var file = widget.file;
|
var file = widget.file;
|
||||||
if (file is MatrixImageFile && !origImage) {
|
if (file is MatrixImageFile && !origImage) {
|
||||||
@ -82,8 +82,14 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: Text(L10n.of(context).send),
|
child: Text(L10n.of(context).send),
|
||||||
onPressed: () async {
|
onPressed: _isSending
|
||||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(_send());
|
? null
|
||||||
|
: () async {
|
||||||
|
setState(() {
|
||||||
|
_isSending = true;
|
||||||
|
});
|
||||||
|
await SimpleDialogs(context)
|
||||||
|
.tryRequestWithLoadingDialog(_send());
|
||||||
await Navigator.of(context).pop();
|
await Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user