From 99447cfc7b9d53756afa52b720c7fbba1f49d93b Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Fri, 16 Feb 2024 12:15:56 +0300 Subject: [PATCH] Web: Added a request for all users regardless of user rights. --- .../sub-components/social-networks/index.js | 20 +++++++++++++------ packages/shared/store/AuthStore.ts | 12 +++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/index.js index d00887c67a..c94e128f20 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/index.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/social-networks/index.js @@ -19,12 +19,17 @@ import { StyledWrapper } from "./styled-social-networks"; const SocialNetworks = (props) => { const { t } = useTranslation(["Profile", "Common"]); - const { providers, setProviders, isOAuthAvailable, setPortalQuota } = props; + const { + providers, + setProviders, + isOAuthAvailable, + //setPortalQuota + } = props; const fetchData = async () => { try { const data = await getAuthProviders(); - if (typeof isOAuthAvailable === "undefined") await setPortalQuota(); + //if (typeof isOAuthAvailable === "undefined") await setPortalQuota(); setProviders(data); } catch (e) { console.error(e); @@ -43,7 +48,7 @@ const SocialNetworks = (props) => { const tokenGetterWin = window.open( link, "login", - "width=800,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no" + "width=800,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no", ); const code = await getOAuthToken(tokenGetterWin); @@ -52,7 +57,7 @@ const SocialNetworks = (props) => { auth: providerName, mode: "popup", callback: "loginCallback", - }) + }), ); tokenGetterWin.location.href = getLoginLink(token, code); @@ -141,12 +146,15 @@ export default inject(({ currentQuotaStore, peopleStore }) => { const { usersStore } = peopleStore; const { providers, setProviders } = usersStore; - const { isOAuthAvailable, setPortalQuota } = currentQuotaStore; + const { + isOAuthAvailable, + //setPortalQuota + } = currentQuotaStore; return { providers, setProviders, isOAuthAvailable, - setPortalQuota, + // setPortalQuota, }; })(observer(SocialNetworks)); diff --git a/packages/shared/store/AuthStore.ts b/packages/shared/store/AuthStore.ts index c99a24a7d6..5d541aeba1 100644 --- a/packages/shared/store/AuthStore.ts +++ b/packages/shared/store/AuthStore.ts @@ -141,7 +141,7 @@ class AuthStore { ) { requests.push( this.userStore?.init(i18n).then(() => { - if (this.isQuotaAvailable && !isPortalRestore) { + if (!isPortalRestore) { this.getTenantExtra(); } }), @@ -273,13 +273,13 @@ class AuthStore { ); } - get isQuotaAvailable() { - const user = this.userStore?.user; + // get isQuotaAvailable() { + // const user = this.userStore?.user; - if (!user) return false; + // if (!user) return false; - return user.isOwner || user.isAdmin || this.isRoomAdmin; - } + // return user.isOwner || user.isAdmin || this.isRoomAdmin; + // } get isPaymentPageAvailable() { const user = this.userStore?.user;