Skip to content
Snippets Groups Projects
Commit 0ab955b2 authored by poka's avatar poka
Browse files

GPT fixed this issue (fake offline detection): #21

parent 60ea8eca
No related branches found
No related tags found
No related merge requests found
Pipeline #18291 waiting for manual action
......@@ -119,11 +119,6 @@ class HomeProvider with ChangeNotifier {
return list[i];
}
void handleSearchStart() {
isSearching = true;
notifyListeners();
}
// void playSound(String customSound, double volume) async {
// await player.play('$customSound.wav',
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
......
......@@ -96,6 +96,8 @@ class _HomeScreenState extends State<HomeScreen> {
// sub.nodeConnected = false;
// }
// Améliore ce code car il y a un bug: parfois l'app se croit hors ligne, alors que c'est faux, le téléphone est bien connecté à internet
// (GPT vscode extension fixed it for my...)
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
Connectivity()
......@@ -108,9 +110,13 @@ class _HomeScreenState extends State<HomeScreen> {
homeProvider.changeMessage("notConnectedToInternet".tr(), 0);
sub.reload();
} else {
await sub.connectNode(context);
// Currency parameters
sub.initCurrencyParameters();
// Check if the phone is actually connected to the internet
var connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult != ConnectivityResult.none) {
await sub.connectNode(context);
// Currency parameters
await sub.initCurrencyParameters();
}
}
// Indexer Blockchain start
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment