GPT fixed this issue (fake offline detection): https://git.duniter.org/clients/gecko/-/issues/21

This commit is contained in:
poka 2022-12-22 23:53:12 +01:00
parent 60ea8ecac1
commit 0ab955b2da
2 changed files with 9 additions and 8 deletions

View File

@ -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);

View File

@ -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