fix(runtime): contact-stores initState httpGet.then setState 加 mounted 保护 (dispose 后 setState)
This commit is contained in:
@@ -383,13 +383,14 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
'service': Constants.WEB_MINISTORE_SERVICE
|
'service': Constants.WEB_MINISTORE_SERVICE
|
||||||
}
|
}
|
||||||
).then((value) {
|
).then((value) {
|
||||||
|
if (!mounted) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
stores = value['stores'];
|
stores = value['stores'];
|
||||||
service = value['service'];
|
service = value['service'];
|
||||||
group = Group.fromJson(value['group']);
|
group = Group.fromJson(value['group']);
|
||||||
print('stores: ${value}');
|
|
||||||
});
|
});
|
||||||
}).onError((error, stackTrace) {
|
}).onError((error, stackTrace) {
|
||||||
|
if (!mounted) return;
|
||||||
Utils.showMessageDialog(context, error, onOk: () {
|
Utils.showMessageDialog(context, error, onOk: () {
|
||||||
Routes.router.navigateTo(context, '/');
|
Routes.router.navigateTo(context, '/');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user