From a0787951782a0e8c7199e7ff83879dd21f6e1660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20PENHO=C3=8BT?= Date: Mon, 30 Nov 2020 17:04:58 +0100 Subject: [PATCH] =?UTF-8?q?Revue=20JS=20frontend=20formulaire=20inscriptio?= =?UTF-8?q?n=20:=20pas=20de=20redirection=20mais=20info=20si=20d=C3=A9j?= =?UTF-8?q?=C3=A0=20connect=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/subscribe.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/front/src/subscribe.js b/front/src/subscribe.js index af423be..05942da 100644 --- a/front/src/subscribe.js +++ b/front/src/subscribe.js @@ -14,7 +14,7 @@ const configUsers = require("../../config/users");// idem pour configurer formul // Importation des fonctions utiles au script : import { getLocaly, removeLocaly, saveLocaly } from "./tools/clientstorage.js"; import { addElement } from "./tools/dom.js"; -import { helloDev } from "./tools/everywhere.js"; +import { helloDev, updateAccountLink } from "./tools/everywhere.js"; import { getDatasFromInputs, setAttributesToInputs } from "./tools/forms.js"; import { loadMatomo } from "./tools/matomo.js"; import { checkAnswerDatas, checkSession, getTimeDifference } from "./tools/users.js"; @@ -37,10 +37,11 @@ const initialise = async () => const isConnected=await checkSession(); if(isConnected) { - saveLocaly("message", { message: alreadyConnected, color:"info" }); + // on change le lien d'accès au compte const user=getLocaly("user", true); - const homePage=user.status+"HomePage"; - window.location.assign("/"+configTemplate[homePage]); + updateAccountLink(user.status, configTemplate); + myForm.style.display="block"; + myForm.innerHTML="

"+alreadyConnected+"

"; } else {