Compare commits
2 Commits
f12e7ac3c1
...
2efb13238c
| Author | SHA1 | Date | |
|---|---|---|---|
|
2efb13238c
|
|||
|
50ad3888f5
|
@@ -11,16 +11,16 @@ export function EventGridContainer() {
|
|||||||
const allEvents: EventInfo[] = isLoading
|
const allEvents: EventInfo[] = isLoading
|
||||||
? []
|
? []
|
||||||
: data.pages.flatMap(page => page.data!).map(it => ({
|
: data.pages.flatMap(page => page.data!).map(it => ({
|
||||||
type: it.type! as EventInfo['type'],
|
type: it.type! as EventInfo['type'],
|
||||||
eventId: it.event_id!,
|
eventId: it.event_id!,
|
||||||
isJoined: it.is_joined!,
|
isJoined: it.is_joined!,
|
||||||
requireKyc: it.enable_kyc!,
|
requireKyc: it.enable_kyc!,
|
||||||
coverImage: it.thumbnail! || PlaceholderImage,
|
coverImage: it.thumbnail! || PlaceholderImage,
|
||||||
eventName: it.name!,
|
eventName: it.name!,
|
||||||
description: it.description!,
|
description: it.description!,
|
||||||
startTime: new Date(it.start_time!),
|
startTime: new Date(it.start_time!),
|
||||||
endTime: new Date(it.end_time!),
|
endTime: new Date(it.end_time!),
|
||||||
} satisfies EventInfo));
|
} satisfies EventInfo));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EventGridView
|
<EventGridView
|
||||||
@@ -28,12 +28,12 @@ export function EventGridContainer() {
|
|||||||
assembleFooter={eventInfo => (eventInfo.isJoined
|
assembleFooter={eventInfo => (eventInfo.isJoined
|
||||||
? <Button className="w-full" disabled>已加入</Button>
|
? <Button className="w-full" disabled>已加入</Button>
|
||||||
: (
|
: (
|
||||||
<KycDialogContainer eventIdToJoin={eventInfo.eventId}>
|
<KycDialogContainer eventIdToJoin={eventInfo.eventId}>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button className="w-full">加入活动</Button>
|
<Button className="w-full">加入活动</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
</KycDialogContainer>
|
</KycDialogContainer>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ export function configInternalApiClient() {
|
|||||||
// Avoid infinite loop if the refresh token request itself fails
|
// Avoid infinite loop if the refresh token request itself fails
|
||||||
if (request.url.includes('/auth/refresh')) {
|
if (request.url.includes('/auth/refresh')) {
|
||||||
// Refresh token failed, clear tokens and redirect to login page
|
// Refresh token failed, clear tokens and redirect to login page
|
||||||
logout('Session expired');
|
logout('会话已过期');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const refreshToken = getRefreshToken();
|
const refreshToken = getRefreshToken();
|
||||||
if (isNil(refreshToken) || isEmpty(refreshToken)) {
|
if (isNil(refreshToken) || isEmpty(refreshToken)) {
|
||||||
logout('You are not logged in');
|
logout('未登录');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const refreshResponse = await doRefreshToken(refreshToken);
|
const refreshResponse = await doRefreshToken(refreshToken);
|
||||||
|
|||||||
Reference in New Issue
Block a user