From e42c72bfe8779f0d172a08c99cba5305f5cb4a3f Mon Sep 17 00:00:00 2001 From: aeddaqqa Date: Sat, 4 Nov 2023 17:20:54 +0100 Subject: [PATCH 1/2] fix display partners while logged in --- src/constants/apps-consts.ts | 4 ++-- src/redux/slices/app-config.ts | 4 ++-- src/views/access/LoadComponent.tsx | 7 ++++++- src/views/landing/LandingPage.tsx | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/constants/apps-consts.ts b/src/constants/apps-consts.ts index 5f44e549..e0427c21 100644 --- a/src/constants/apps-consts.ts +++ b/src/constants/apps-consts.ts @@ -20,13 +20,13 @@ export const APPS_CONSTS = [ }, { name: 'Settings', - subText: 'Lookup network activity and statistics.', + subText: 'Manage your wallet settings.', url: '/settings', private: true, hidden: true, }, { - name: 'Partners', + name: 'Foundation', subText: 'Lookup network activity and statistics.', url: '/foundation', private: true, diff --git a/src/redux/slices/app-config.ts b/src/redux/slices/app-config.ts index 3ea577ff..9b44cec7 100644 --- a/src/redux/slices/app-config.ts +++ b/src/redux/slices/app-config.ts @@ -57,7 +57,7 @@ const appConfigSlice = createSlice({ }, updateApps(state, { payload }) { if (payload) { - state.apps.find(elem => elem.name === 'Partners') + state.apps.find(elem => elem.name === 'Foundation') let t = state.apps t[4].hidden = false state.apps = [...t] @@ -71,7 +71,7 @@ const appConfigSlice = createSlice({ extraReducers: builder => { builder.addCase(updateAuthStatus.fulfilled, (state, { payload }) => { if (store.getters['Platform/isOfferCreator']) { - state.apps.find(elem => elem.name === 'Partners') + state.apps.find(elem => elem.name === 'Foundation') let t = state.apps t[4].hidden = false state.apps = [...t] diff --git a/src/views/access/LoadComponent.tsx b/src/views/access/LoadComponent.tsx index 46c84b08..29669209 100644 --- a/src/views/access/LoadComponent.tsx +++ b/src/views/access/LoadComponent.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState } from 'react' import { mountAccessComponents } from 'wallet/mountAccessComponents' +import store from 'wallet/store' import { useAppDispatch } from '../../hooks/reduxHooks' import { useEffectOnce } from '../../hooks/useEffectOnce' import { updateAccount, updateValues } from '../../redux/slices/app-config' @@ -10,10 +11,14 @@ const LoadComponent = ({ type, props }) => { const [updateStore, setUpdateStore] = useState(null) const dispatch = useAppDispatch() const setAccount = account => dispatch(updateAccount(account)) + async function updateAuth() { + await store.dispatch('Platform/updateAddressStates') + dispatch(updateAuthStatus(updateStore?.isAuth)) + } useEffect(() => { dispatch(updateValues(updateStore)) if (updateStore?.isAuth) { - dispatch(updateAuthStatus(updateStore?.isAuth)) + updateAuth() } }, [updateStore]) // eslint-disable-line react-hooks/exhaustive-deps diff --git a/src/views/landing/LandingPage.tsx b/src/views/landing/LandingPage.tsx index 9e658b2c..284197c2 100644 --- a/src/views/landing/LandingPage.tsx +++ b/src/views/landing/LandingPage.tsx @@ -41,7 +41,7 @@ export default function LandingPage() { {allApps?.map((app, index) => { if ( !app.hidden && - (app.private === false || (app.name === 'Partners' && isAuth)) + (app.private === false || (app.name === 'Foundation' && isAuth)) ) return ( From 716a4754f3d89f2f6c5a3df3460665fb61d87145 Mon Sep 17 00:00:00 2001 From: aeddaqqa Date: Mon, 6 Nov 2023 09:27:44 +0100 Subject: [PATCH 2/2] adjust subtext of foundation card --- src/constants/apps-consts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/apps-consts.ts b/src/constants/apps-consts.ts index e0427c21..f159326c 100644 --- a/src/constants/apps-consts.ts +++ b/src/constants/apps-consts.ts @@ -27,7 +27,7 @@ export const APPS_CONSTS = [ }, { name: 'Foundation', - subText: 'Lookup network activity and statistics.', + subText: 'Tools for foundation members.', url: '/foundation', private: true, hidden: true,