Skip to content

Commit

Permalink
fix(app): Ensure that we only notify listeners when it matters
Browse files Browse the repository at this point in the history
  • Loading branch information
luckysori committed Aug 18, 2023
1 parent d8ee300 commit 73e3a3a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mobile/lib/common/service_status_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ class ServiceStatusNotifier extends ChangeNotifier implements Subscriber {
FLog.debug(text: "Received event: ${event.toString()}");
var update = event.field0;
services[update.service] = update.status;

notifyListeners();
} else {
FLog.warning(text: "Received unexpected event: ${event.toString()}");
}
notifyListeners();
}
}

Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/features/trade/order_change_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class OrderChangeNotifier extends ChangeNotifier implements Subscriber {
orders[order.id] = order;

sortOrderByTimestampDesc();

notifyListeners();
} else {
FLog.warning(text: "Received unexpected event: ${event.toString()}");
}

notifyListeners();
}

void sortOrderByTimestampDesc() {
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/features/trade/position_change_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class PositionChangeNotifier extends ChangeNotifier implements Subscriber {
}
}
}

notifyListeners();
} else {
FLog.warning(text: "Received unexpected event: ${event.toString()}");
}

notifyListeners();
}
}

0 comments on commit 73e3a3a

Please sign in to comment.