Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
herzhenr committed Aug 20, 2023
1 parent e909a25 commit 199aefc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions lib/screens/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class _HomePageState extends State<HomePage> {
@override
void dispose() {
_pingDevicesTimer?.cancel();
// print('---------timer canceled----------');
super.dispose();
}

Expand Down Expand Up @@ -136,7 +135,6 @@ class _HomePageState extends State<HomePage> {
/// of the devices and update the ui accordingly
void _pingDevices() {
checkAllDevicesStatus();
// print('---------timer started----------');
_pingDevicesTimer = Timer.periodic(const Duration(seconds: 16), (timer) {
checkAllDevicesStatus();
});
Expand All @@ -153,7 +151,6 @@ class _HomePageState extends State<HomePage> {
/// [device] is the device to ping
/// if the widget is not mounted anymore, the function will stop
Future<void> checkDeviceStatus(StorageDevice device) async {
// print('pinging device: ${device.hostName}');
bool isOnline = await pingDevice(ipAddress: device.ipAddress);
if (mounted) {
setState(() {
Expand Down Expand Up @@ -248,7 +245,6 @@ class _HomePageState extends State<HomePage> {
return RefreshIndicator(
onRefresh: () async {
_pingDevicesTimer?.cancel();
// print('---------timer canceled----------');
// set online state for all devices to null because online state is not known yet
for (StorageDevice device in _devices) {
device.isOnline = null;
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/layout_elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ class DeviceCard extends StatelessWidget {
color: isOnline == null
? Colors.grey
: isOnline!
? Colors.green
: Colors.redAccent),
? AppConstants.successMessageColor
: AppConstants.errorMessageColor),
)
],
))
Expand Down

0 comments on commit 199aefc

Please sign in to comment.