diff --git a/web-app/src/components/layout/site/AppHeader/index.tsx b/web-app/src/components/layout/site/AppHeader/index.tsx index 90fa52be..4a88237d 100644 --- a/web-app/src/components/layout/site/AppHeader/index.tsx +++ b/web-app/src/components/layout/site/AppHeader/index.tsx @@ -18,7 +18,7 @@ import { useRouter } from "next/navigation"; import { useCallback, useState } from "react"; const AppHeader = () => { - const { connect, disconnect, status, setStatus } = useAuth(); + const { connect, disconnect, status, setStatus, session } = useAuth(); const router = useRouter(); const { isLanding } = useRouteParams(); const [modalVisible, setModalVisible] = useState(false); @@ -30,7 +30,7 @@ const AppHeader = () => { setGuestModalVisible, } = useApp(); - const { data: userProfile } = useAppSelector(selectDID); + const { userProfile } = useAppSelector(selectDID); const handleDisconnect = useCallback(async () => { try { diff --git a/web-app/src/components/sections/landing/UseCases/index.tsx b/web-app/src/components/sections/landing/UseCases/index.tsx index 6b01fa0f..a4270e85 100644 --- a/web-app/src/components/sections/landing/UseCases/index.tsx +++ b/web-app/src/components/sections/landing/UseCases/index.tsx @@ -118,9 +118,7 @@ const UseCasesSection = () => {

Index, as a discovery primitive, makes many different use-cases possible, ranging from science, journalism, e-commerce, social and - many more.
-
- Here are four examples that we are most excited about: + many more. Here are four examples that we are most excited about:

diff --git a/web-app/src/context/AppContext.tsx b/web-app/src/context/AppContext.tsx index c15035d2..018da70a 100644 --- a/web-app/src/context/AppContext.tsx +++ b/web-app/src/context/AppContext.tsx @@ -165,7 +165,9 @@ export const AppContextProvider = ({ children }: AppContextProviderProps) => { isFetchingDIDRef.current = true; - await dispatch(fetchDID({ didID, api })).unwrap(); + await dispatch( + fetchDID({ didID, api, isUser: session?.did.parent === didID }), + ).unwrap(); isFetchingDIDRef.current = false; } catch (error) { diff --git a/web-app/src/store/api/did.ts b/web-app/src/store/api/did.ts index 99e5560c..aa59a8a4 100644 --- a/web-app/src/store/api/did.ts +++ b/web-app/src/store/api/did.ts @@ -18,6 +18,7 @@ type FetchDIDPayload = { didID: string; api: ApiService; ignoreDiscoveryType?: boolean; + isUser?: boolean; }; type FetchDIDIndexesPayload = { @@ -33,7 +34,7 @@ type FetchDIDConversationsPayload = { export const fetchDID = createAsyncThunk( "did/fetchDid", async ( - { didID, api, ignoreDiscoveryType }: FetchDIDPayload, + { didID, api, ignoreDiscoveryType, isUser = false }: FetchDIDPayload, { dispatch, rejectWithValue, getState }, ) => { try { @@ -56,7 +57,7 @@ export const fetchDID = createAsyncThunk( } } - return did; + return { isUser, did }; } catch (err: any) { console.error("322 Error fetching DID:", err); return rejectWithValue(err.response.data); diff --git a/web-app/src/store/slices/didSlice.ts b/web-app/src/store/slices/didSlice.ts index 5ddbd838..90335c9a 100644 --- a/web-app/src/store/slices/didSlice.ts +++ b/web-app/src/store/slices/didSlice.ts @@ -34,6 +34,7 @@ const didSlice = createSlice({ loading: false, error: null, avatar: null as any, + userProfile: null as any, }, reducers: { setProfile: (state, action) => { @@ -77,7 +78,11 @@ const didSlice = createSlice({ }) .addCase(fetchDID.fulfilled, (state, action) => { state.loading = false; - state.data = action.payload; + const { did, isUser } = action.payload; + state.data = did; + if (isUser) { + state.userProfile = did; + } }) .addCase(fetchDID.rejected, (state, action) => { state.loading = false;