fix(runtime): e2e 发现的 3 个 bug 修复
- download: desktop_download_apps SingleChildScrollView 加 primary:true (Scrollbar 缺 ScrollPosition) - contact-stores: checkDomainAvailability async 后 setState 加 mounted 保护 (dispose 后 setState) - buy-service: _loadData 加 data 结构校验 + mounted 保护 (API 400 无效参数时 data 为错误结构 -> RangeError)
This commit is contained in:
@@ -72,12 +72,16 @@ class BuyServiceState extends State<BuyService> {
|
||||
'store_id': '${widget.sid}',
|
||||
}
|
||||
).then((value) {
|
||||
if (!mounted) return;
|
||||
if (value == null || value is! Map || value['service_selections'] == null) {
|
||||
Utils.showMessageDialog(context, 'Service info unavailable');
|
||||
return;
|
||||
}
|
||||
data = value;
|
||||
data!['domain'] = widget.domain;
|
||||
print('data: $data');
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
if (mounted) Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -411,7 +411,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
||||
print('value: $value');
|
||||
if (value['status'] == 'OK') {
|
||||
domainResult = (value['domain_check_result'] as List);
|
||||
setState(() {});
|
||||
if (mounted) setState(() {});
|
||||
} else if (value['status'] == 'ERROR') {
|
||||
String errors = '';
|
||||
for (int i = 0; i < (value['errors'] as List).length; i++) {
|
||||
|
||||
@@ -55,6 +55,7 @@ class DesktopDownloadAppsState extends State<DesktopDownloadApps> {
|
||||
}
|
||||
col.children.add(wrap);
|
||||
Widget view = SingleChildScrollView(
|
||||
primary: true,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
|
||||
Reference in New Issue
Block a user