Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix display partners while logged in #170

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading