From 11eb494ca5ccc2a657f77aa26b1bda22f1422b68 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Thu, 24 Mar 2016 20:13:59 +0100
Subject: [PATCH] Fix: sync was sometimes stuck

---
 app/js/controllers/init/sync/SyncController.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/js/controllers/init/sync/SyncController.js b/app/js/controllers/init/sync/SyncController.js
index 07421e2..6baa7d4 100644
--- a/app/js/controllers/init/sync/SyncController.js
+++ b/app/js/controllers/init/sync/SyncController.js
@@ -2,7 +2,7 @@
 
 var co = require('co');
 
-module.exports = ($scope, $http, $state, $stateParams, BMA, UIUtils) => {
+module.exports = ($scope, $http, $state, $timeout, $stateParams, BMA, UIUtils) => {
 
   let syncWS = BMA.webmin.ws();
 
@@ -43,6 +43,10 @@ module.exports = ($scope, $http, $state, $stateParams, BMA, UIUtils) => {
           $scope.sync_failed = data.value;
           if (data.value === true) {
             $state.go('index');
+          } else {
+            $timeout(() => {
+              window.location.href = "";
+            }, 500);
           }
         } else {
           let changed = true;
-- 
GitLab