Skip to content

Commit

Permalink
Revert "fix(storage): 修复错误提示显示两次的问题 (#94)"
Browse files Browse the repository at this point in the history
This reverts commit c458887.
  • Loading branch information
he0119 committed Dec 18, 2020
1 parent d31b0d5 commit af7e9b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/pages/storage/item_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class _ItemEditPageState extends State<ItemEditPage> {
if (state is ItemUpdateSuccess) {
showInfoSnackBar('物品 ${state.item.name} 修改成功');
}
if (state is ItemEditFailure) {
showErrorSnackBar(state.message);
}
// 物品添加和修改成功过后自动返回物品详情界面
if (state is ItemAddSuccess || state is ItemUpdateSuccess) {
Navigator.of(context).pop();
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/storage/storage_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ class _StorageEditPageState extends State<StorageEditPage> {
if (state is StorageUpdateSuccess) {
showInfoSnackBar('位置 ${state.storage.name} 修改成功');
}
if (state is StorageEditFailure) {
showErrorSnackBar(state.message);
}
},
builder: (context, state) => Form(
key: _formKey,
Expand Down

0 comments on commit af7e9b7

Please sign in to comment.