Skip to content

Commit

Permalink
fix: session data anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadapema committed Jan 23, 2025
1 parent 3beeb4e commit f02fbe9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/publication-detail-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default function PublicationDetailMain({
sx={{
width: 26,
height: 26,
border: (theme) => `solid 2px ${theme.palette.background.default}`,
border: (theme: any) => `solid 2px ${theme.palette.background.default}`,
}}
/>
<Typography variant="subtitle2" noWrap sx={{ ml: 1 }}>
Expand Down Expand Up @@ -338,7 +338,7 @@ export default function PublicationDetailMain({
pr: 1,
}}
>
{hasAccess ? (
{hasAccess && sessionData?.authenticated ? (
// @ts-ignore
<LeaveTipCard post={post} />
) : (
Expand Down
3 changes: 1 addition & 2 deletions src/components/subscribe-to-unlock-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface Props {
export const SubscribeToUnlockCard = ({
onSubscribe,
loadingSubscribe,
subscribeDisabled,
post,
}: Props) => {
const { terms } = useGetPolicyTerms(
Expand Down Expand Up @@ -58,7 +57,7 @@ export const SubscribeToUnlockCard = ({
sx={{ width: '100%', py: 1.5 }}
onClick={onSubscribe}
loading={loadingSubscribe}
disabled={subscribeDisabled}
// disabled={subscribeDisabled}
>
<IconPlayerPlay size={20} style={{ marginRight: 5 }} />
Join
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/use-account-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export const useAccountSession = (): UseAccountSessionHook => {
// wait for web3auth ready state and allow bypass if
if ((isPending() || loading) && !data?.authenticated) return;
// is authenticated avoid re-run code below
if (sessionData?.authenticated) return;
if (sessionData?.authenticated || data?.type === 'ANONYMOUS') return;
// dispatch the session data and turn off the loading
dispatch(setSession({ session: data }))
dispatch(setAuthLoading({ isSessionLoading: false }));
}, [isSessionLoading]);
}, [isSessionLoading, data]);

return {
logout: handleSessionExpired,
Expand Down
2 changes: 1 addition & 1 deletion src/sections/publication/view/publication-details-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default function PublicationDetailsView({ id }: Props) {
zIndex: 2,
}}
onClick={handleSubscribe}
disabled={accessLoading || hasAccess || accessFetchingLoading}
// disabled={accessLoading || hasAccess || accessFetchingLoading}
loading={accessLoading || accessFetchingLoading}
>
<IconPlayerPlay fontSize="large" size={18} />
Expand Down

0 comments on commit f02fbe9

Please sign in to comment.