Skip to content

Commit

Permalink
fix display partners while logged in (#170)
Browse files Browse the repository at this point in the history
* fix display partners while logged in

* adjust subtext of foundation card
  • Loading branch information
aeddaqqa authored Nov 6, 2023
1 parent 5b13c19 commit 06a6ad8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/constants/apps-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ 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',
subText: 'Lookup network activity and statistics.',
name: 'Foundation',
subText: 'Tools for foundation members.',
url: '/foundation',
private: true,
hidden: true,
Expand Down
4 changes: 2 additions & 2 deletions src/redux/slices/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
7 changes: 6 additions & 1 deletion src/views/access/LoadComponent.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/views/landing/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Grid item key={index} xs={12} sm={12} md>
Expand Down

0 comments on commit 06a6ad8

Please sign in to comment.