diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 2b39c940..4eba3c0a 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -230,12 +230,6 @@ class _LiberationHistoryWidgetState extends State { ) .then((value) { if (value) { - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - - context.pop(); SnackBarUtil.showSnackBar( context, FFLocalizations.of(context).getVariableText( @@ -254,7 +248,14 @@ class _LiberationHistoryWidgetState extends State { isError: true, ); } - }).whenComplete(() {}); + }).whenComplete(() { + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + + context.pop(); + }); }, ), if (liberationHistoryItem['NOT_STATUS'] == 'S') @@ -283,12 +284,7 @@ class _LiberationHistoryWidgetState extends State { id: liberationHistoryItem['VTE_ID'].toString(), ) .then((message) { - safeSetState(() { - _requestWrap = []; - _requestFuture = _fetchRequests(); - }); - context.pop(); - if (message == null || message == '') { + if (message != null || message != '') { showSnackbar( context, FFLocalizations.of(context).getVariableText( @@ -300,7 +296,13 @@ class _LiberationHistoryWidgetState extends State { } else { showSnackbar(context, message, true); } - }).whenComplete(() {}); + }).whenComplete(() { + safeSetState(() { + _requestWrap = []; + _requestFuture = _fetchRequests(); + }); + context.pop(); + }); }, ) ],