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];
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue