From 19d7a8035528b7b447faaeb93fa023785a5f706f Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Sun, 5 Apr 2020 22:47:37 +0200
Subject: [PATCH] Fix for number 22 issue

---
 src/index.pug                        | 3 +++
 src/scripts/dispatch-space-n-user.js | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/index.pug b/src/index.pug
index 367c3ca4..62d99ece 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -18,6 +18,9 @@ html
         #entrepreneur-dashboard(hidden).no-sidebar
             include includes/entrepreneur/dashboard.pug
             
+        #public-dashboard(hidden).no-sidebar
+            include includes/public/dashboard.pug
+
         #splash(hidden).no-sidebar.container.flex
             include includes/splash.pug
 
diff --git a/src/scripts/dispatch-space-n-user.js b/src/scripts/dispatch-space-n-user.js
index b4dc1981..58d115b2 100644
--- a/src/scripts/dispatch-space-n-user.js
+++ b/src/scripts/dispatch-space-n-user.js
@@ -77,10 +77,8 @@ class CoopStarterLoginComponent extends HTMLElement {
       var newUrl = window.location.href.replace(/\/([a-z]+)-dashboard\/([a-z]+)-resource-detail/, `/${userPrefix}-dashboard/${userPrefix}-resource-detail`)
 
       //If the url is different after the treatment, we reload with the good url
-      if(newUrl !== window.location.href){
-        console.log(newUrl);
+      if (newUrl !== window.location.href) {
         var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, "");
-        console.log(newRoute.split(/\/(.*?)\//)[1]);
         window.dispatchEvent(
           new CustomEvent('requestNavigation', { 
             detail: {
@@ -89,6 +87,8 @@ class CoopStarterLoginComponent extends HTMLElement {
             }
           })
         );
+        window.location.href = newUrl;
+        loader.toggleAttribute('hidden', true);
       } else {
         loader.toggleAttribute('hidden', true);
       }
-- 
GitLab