Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit cc10239

Browse files
committed
Bug fixes
1 parent 117ff59 commit cc10239

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

lib/models/log.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Log {
33
final String type;
44
final String url;
55
final String device;
6-
final String status;
6+
final String? status;
77
final String replyType;
88
final BigInt replyTime;
99
final String? answeredBy;

lib/screens/logs/log_details_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ class LogDetailsScreen extends StatelessWidget {
116116
label: AppLocalizations.of(context)!.time,
117117
description: formatTimestamp(log.dateTime, 'HH:mm:ss'),
118118
),
119-
item(
119+
if (log.status != null) item(
120120
Icons.shield_outlined,
121121
AppLocalizations.of(context)!.status,
122-
LogStatus(status: log.status, showIcon: false)
122+
LogStatus(status: log.status!, showIcon: false)
123123
),
124124
if (log.status == '2' && log.answeredBy != null) CustomListTile(
125125
leadingIcon: Icons.domain,

lib/screens/logs/log_tile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class LogTile extends StatelessWidget {
4646
child: Column(
4747
crossAxisAlignment: CrossAxisAlignment.start,
4848
children: [
49-
LogStatus(status: log.status, showIcon: true),
49+
if (log.status != null) LogStatus(status: log.status!, showIcon: true),
5050
const SizedBox(height: 10),
5151
SizedBox(
5252
child: Text(
@@ -102,7 +102,7 @@ class LogTile extends StatelessWidget {
102102
child: Column(
103103
crossAxisAlignment: CrossAxisAlignment.start,
104104
children: [
105-
LogStatus(status: log.status, showIcon: true),
105+
if (log.status != null) LogStatus(status: log.status!, showIcon: true),
106106
const SizedBox(height: 10),
107107
SizedBox(
108108
child: Text(

lib/screens/logs/logs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class _LogsState extends State<Logs> {
136136
List<Log> tempLogs = logs != null ? [...logs] : [...logsList];
137137

138138
tempLogs = tempLogs.where((log) {
139-
if (statusSelected.contains(int.parse(log.status))) {
139+
if (log.status != null && statusSelected.contains(int.parse(log.status!))) {
140140
return true;
141141
}
142142
else {

lib/screens/servers/servers_tile_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class _ServersTileItemState extends State<ServersTileItem> with SingleTickerProv
115115
if (result['result'] == 'success') {
116116
await connectSuccess(result);
117117
}
118-
else {
118+
else if (mounted) {
119119
showSnackBar(
120120
appConfigProvider: appConfigProvider,
121121
label: AppLocalizations.of(context)!.cannotConnect,

0 commit comments

Comments
 (0)