From 9d5f1daaa585bcfcba03f6e1cb159f0470c91e96 Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Sun, 4 Apr 2021 21:17:29 +0200
Subject: [PATCH] Fix sound in start

---
 lib/main.dart                 | 6 ++++++
 lib/models/home.dart          | 3 ---
 lib/models/walletOptions.dart | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/main.dart b/lib/main.dart
index b03d66e2..5cc481d1 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -53,6 +53,12 @@ Future<void> main() async {
   // Get a valid GVA endpoint
   endPointGVA = await _homeProvider.getValidEndpoint();
 
+  if (endPointGVA == 'HS') {
+    _homeProvider.playSound('faché');
+  } else {
+    _homeProvider.playSound('start');
+  }
+
   if (kReleaseMode && enableSentry) {
     // CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
     //   SentryHandler(SentryClient(SentryOptions(
diff --git a/lib/models/home.dart b/lib/models/home.dart
index 1ab7c03c..42ec6623 100644
--- a/lib/models/home.dart
+++ b/lib/models/home.dart
@@ -61,11 +61,8 @@ class HomeProvider with ChangeNotifier {
       int listLenght = _listEndpoints.length - 1;
       if (i > listLenght) {
         log.e('NO VALID GVA ENDPOINT FOUND');
-        playSound('faché');
         _endpoint = 'HS';
         break;
-      } else {
-        playSound('start');
       }
       if (i != 0) {
         await Future.delayed(const Duration(milliseconds: 300));
diff --git a/lib/models/walletOptions.dart b/lib/models/walletOptions.dart
index 4381cd09..55974fa0 100644
--- a/lib/models/walletOptions.dart
+++ b/lib/models/walletOptions.dart
@@ -157,7 +157,7 @@ class WalletOptionsProvider with ChangeNotifier {
       context, _walletName, _walletNbr, _derivation) async {
     return showDialog<bool>(
       context: context,
-      barrierDismissible: true, // user must tap button!
+      barrierDismissible: true,
       builder: (BuildContext context) {
         return AlertDialog(
           title: Text('Choisissez un nouveau nom pour ce portefeuille'),
-- 
GitLab