From 2ceedcea61f49b49eb8bf8acc84096a570d93f3b Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Thu, 2 Nov 2017 14:21:05 +0100
Subject: [PATCH] Join: Allow to click on the "approve license"  button, after
 5s -  fix #592

---
 app/config.json                        | 4 ++--
 www/js/config.js                       | 4 ++--
 www/js/controllers/app-controllers.js  | 8 +-------
 www/js/controllers/join-controllers.js | 9 ++++++++-
 www/js/services/modal-services.js      | 8 +++++++-
 5 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/app/config.json b/app/config.json
index 1cb926049..673009320 100644
--- a/app/config.json
+++ b/app/config.json
@@ -274,8 +274,8 @@
       }
     },
     "license": {
-      "fr-FR": "license/license_g1-fr-FR.txt",
-      "en": "license/license_g1-en.txt"
+      "fr-FR": "license/license_g1-fr-FR",
+      "en": "license/license_g1-en"
     },
     "node": {
       "host": "g1.duniter.fr",
diff --git a/www/js/config.js b/www/js/config.js
index 04a5851c6..79ae16cb4 100644
--- a/www/js/config.js
+++ b/www/js/config.js
@@ -29,8 +29,8 @@ angular.module("cesium.config", [])
 		}
 	},
 	"license": {
-		"fr-FR": "license/license_g1-fr-FR.txt",
-		"en": "license/license_g1-en.txt"
+		"fr-FR": "license/license_g1-fr-FR",
+		"en": "license/license_g1-en"
 	},
 	"node": {
 		"host": "g1.duniter.org",
diff --git a/www/js/controllers/app-controllers.js b/www/js/controllers/app-controllers.js
index 7f48abcb7..b36b28235 100644
--- a/www/js/controllers/app-controllers.js
+++ b/www/js/controllers/app-controllers.js
@@ -357,13 +357,7 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
 
   $scope.showJoinModal = function() {
     $scope.closeProfilePopover();
-    return Modals.showJoin()
-      .then(function(res){
-        if (!res) return;
-        return (res.accountType == 'member') ?
-          Modals.showJoinMember(res) :
-          Modals.showJoinWallet(res);
-      });
+    return Modals.showJoin();
   };
 
   $scope.showSettings = function() {
diff --git a/www/js/controllers/join-controllers.js b/www/js/controllers/join-controllers.js
index f1a8426b3..21a540154 100644
--- a/www/js/controllers/join-controllers.js
+++ b/www/js/controllers/join-controllers.js
@@ -144,7 +144,14 @@ function JoinModalController($scope, $state, $interval, $timeout, Device, UIUtil
             $scope.licenseFileUrl = $scope.licenseFileUrl + '.html';
           }
           if (!$scope.isLicenseRead) {
-            $scope.startListenLicenseBottom();
+            //$scope.startListenLicenseBottom();
+
+            // Make sure to enable the next button when error occured - Fix issue #592
+            $timeout(function() {
+              if (!$scope.isLicenseRead) {
+                $scope.isLicenseRead = true;
+              }
+            }, 5000);
           }
         }
       }
diff --git a/www/js/services/modal-services.js b/www/js/services/modal-services.js
index 86d684c37..94876acb8 100644
--- a/www/js/services/modal-services.js
+++ b/www/js/services/modal-services.js
@@ -173,7 +173,13 @@ angular.module('cesium.modal.services', [])
 
   function showJoin(parameters) {
     return ModalUtils.show('templates/join/modal_choose_account_type.html','JoinChooseAccountTypeModalCtrl',
-      parameters);
+      parameters)
+      .then(function(res){
+        if (!res) return;
+        return (res.accountType == 'member') ?
+          showJoinMember(res) :
+          showJoinWallet(res);
+      });
   }
 
   function showJoinMember(parameters) {
-- 
GitLab