GPT fixed this issue (fake offline detection): https://git.duniter.org/clients/gecko/-/issues/21
This commit is contained in:
parent
60ea8ecac1
commit
0ab955b2da
|
@ -119,11 +119,6 @@ class HomeProvider with ChangeNotifier {
|
||||||
return list[i];
|
return list[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleSearchStart() {
|
|
||||||
isSearching = true;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
// void playSound(String customSound, double volume) async {
|
// void playSound(String customSound, double volume) async {
|
||||||
// await player.play('$customSound.wav',
|
// await player.play('$customSound.wav',
|
||||||
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
|
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
|
||||||
|
|
|
@ -96,6 +96,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
// sub.nodeConnected = false;
|
// 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 =
|
HomeProvider homeProvider =
|
||||||
Provider.of<HomeProvider>(context, listen: false);
|
Provider.of<HomeProvider>(context, listen: false);
|
||||||
Connectivity()
|
Connectivity()
|
||||||
|
@ -108,9 +110,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
homeProvider.changeMessage("notConnectedToInternet".tr(), 0);
|
homeProvider.changeMessage("notConnectedToInternet".tr(), 0);
|
||||||
sub.reload();
|
sub.reload();
|
||||||
} else {
|
} else {
|
||||||
await sub.connectNode(context);
|
// Check if the phone is actually connected to the internet
|
||||||
// Currency parameters
|
var connectivityResult = await (Connectivity().checkConnectivity());
|
||||||
sub.initCurrencyParameters();
|
if (connectivityResult != ConnectivityResult.none) {
|
||||||
|
await sub.connectNode(context);
|
||||||
|
// Currency parameters
|
||||||
|
await sub.initCurrencyParameters();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indexer Blockchain start
|
// Indexer Blockchain start
|
||||||
|
|
Loading…
Reference in New Issue