From 171d19b2f4962bc6cc6aacb4067f230d71f94c67 Mon Sep 17 00:00:00 2001 From: underpostnet Date: Tue, 31 Dec 2024 14:50:56 +0000 Subject: [PATCH] Update github repo package --- src/client/components/core/LogIn.js | 8 +++++++- src/client/components/core/Modal.js | 4 +--- src/client/components/core/VanillaJs.js | 5 ++++- src/client/components/default/LogInDefault.js | 3 --- src/server/conf.js | 1 + 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/client/components/core/LogIn.js b/src/client/components/core/LogIn.js index 98816b6..d83b1a0 100644 --- a/src/client/components/core/LogIn.js +++ b/src/client/components/core/LogIn.js @@ -103,7 +103,13 @@ const LogIn = { if ('model' in inputData) body[inputData.model] = s(`.${inputData.id}`).value; } const result = await UserService.post({ id: 'auth', body }); - if (result.status === 'success') await Auth.sessionIn(result); + if (result.status === 'success') { + await Auth.sessionIn(result); + setTimeout(() => { + if (s(`.modal-log-in`)) s(`.btn-close-modal-log-in`).click(); + if (s(`.modal-sign-up`)) s(`.btn-close-modal-sign-up`).click(); + }); + } if (result.status === 'error' && result.message.match('attempts')) { htmls(`.login-attempt-warn-value`, result.message.split(':')[1]); s(`.login-attempt-warn-container`).classList.remove('hide'); diff --git a/src/client/components/core/Modal.js b/src/client/components/core/Modal.js index 4d81be4..28fa20a 100644 --- a/src/client/components/core/Modal.js +++ b/src/client/components/core/Modal.js @@ -1327,7 +1327,6 @@ const Modal = { case 'slide-menu-right': case 'slide-menu-left': const backMenuButtonEvent = async () => { - if (location.pathname !== getProxyPath()) setPath(getProxyPath()); if (s(`.menu-btn-container-children`)) htmls(`.menu-btn-container-children`, ''); // htmls(`.nav-title-display-${'modal-menu'}`, html` ${Translate.Render('home')}`); htmls(`.nav-title-display-${'modal-menu'}`, html``); @@ -1346,8 +1345,7 @@ const Modal = { backMenuButtonEvent(); } s(`.btn-close-modal-menu`).click(); - if (window.location.pathname !== (getProxyPath() === '/' ? getProxyPath() : `${getProxyPath()}/`)) - setPath(getProxyPath()); + setPath(getProxyPath()); setDocTitle({ ...options.RouterInstance, route: '' }); }; EventsUI.onClick(`.btn-icon-menu-back`, backMenuButtonEvent); diff --git a/src/client/components/core/VanillaJs.js b/src/client/components/core/VanillaJs.js index 8b6787a..1e9a42b 100644 --- a/src/client/components/core/VanillaJs.js +++ b/src/client/components/core/VanillaJs.js @@ -148,7 +148,10 @@ const pasteData = () => new Promise((resolve) => navigator.clipboard.readText(). * history. * @memberof VanillaJS */ -const setPath = (path = '/', stateStorage = {}, title = '') => history.pushState(stateStorage, title, path); +const setPath = (path = '/', stateStorage = {}, title = '') => { + if (window.location.pathname === path || window.location.pathname === `${path}/`) return; + return history.pushState(stateStorage, title, path); +}; /** * The function `getQueryParams` extracts query parameters from the current URL and returns them as an diff --git a/src/client/components/default/LogInDefault.js b/src/client/components/default/LogInDefault.js index aeeb68e..16a128b 100644 --- a/src/client/components/default/LogInDefault.js +++ b/src/client/components/default/LogInDefault.js @@ -12,9 +12,6 @@ const LogInDefault = async function () { s(`.main-btn-sign-up`).style.display = 'none'; s(`.main-btn-log-out`).style.display = null; s(`.main-btn-account`).style.display = null; - - if (s(`.modal-log-in`)) s(`.btn-close-modal-log-in`).click(); - if (s(`.modal-sign-up`)) s(`.btn-close-modal-sign-up`).click(); }; const { user } = await Auth.sessionIn(); ElementsDefault.Data.user.main.model.user = user; diff --git a/src/server/conf.js b/src/server/conf.js index fbbc56d..65eca17 100644 --- a/src/server/conf.js +++ b/src/server/conf.js @@ -935,6 +935,7 @@ const maintenanceMiddleware = (req, res, port, proxyRouter) => { const setUpProxyMaintenanceServer = ({ deployGroupId }) => { shellExec(`pm2 kill`); + shellExec(`node bin/deploy valkey-service`); const proxyDeployId = fs.readFileSync(`./engine-private/deploy/${deployGroupId}.proxy`, 'utf8').trim(); shellExec(`node bin/deploy conf ${proxyDeployId} production`); shellExec(`node bin/deploy run ${proxyDeployId} maintenance`);