mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 10:29:23 +00:00
Fix connection leak when service bulletin is disabled (#1465)
* Fix connection leak when service bulletin disabled * Update dashboard_view_model.dart --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
7d0720b21d
commit
0dc53895c6
1 changed files with 21 additions and 16 deletions
|
@ -535,6 +535,7 @@ abstract class DashboardViewModelBase with Store {
|
||||||
|
|
||||||
Future<ServicesResponse> getServicesStatus() async {
|
Future<ServicesResponse> getServicesStatus() async {
|
||||||
try {
|
try {
|
||||||
|
if (isEnabledBulletinAction) {
|
||||||
final res = await http.get(Uri.parse("https://service-api.cakewallet.com/v1/active-notices"));
|
final res = await http.get(Uri.parse("https://service-api.cakewallet.com/v1/active-notices"));
|
||||||
|
|
||||||
if (res.statusCode < 200 || res.statusCode >= 300) {
|
if (res.statusCode < 200 || res.statusCode >= 300) {
|
||||||
|
@ -553,6 +554,10 @@ abstract class DashboardViewModelBase with Store {
|
||||||
hasUpdates,
|
hasUpdates,
|
||||||
currentSha,
|
currentSha,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ServicesResponse([], false, '');
|
||||||
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return ServicesResponse([], false, '');
|
return ServicesResponse([], false, '');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue