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 campaign fetching #4682

Merged
merged 3 commits into from
Jul 25, 2024
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
12 changes: 6 additions & 6 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
"defaultMessage": "密码"
},
"5y5rID": {
"defaultMessage": "我们将尽快审核你的申请,敬请期待活动开跑!"
"defaultMessage": "我们将尽快处理你的申请,敬请期待活动开跑!"
},
"6+eeJ4": {
"defaultMessage": "可使用小写英文、数字及下划线",
Expand Down Expand Up @@ -1070,7 +1070,7 @@
"defaultMessage": "用户名"
},
"HB2VOx": {
"defaultMessage": "系統或連線異常,請刷新頁面後重新點擊報名參加"
"defaultMessage": "系统或连线异常,请刷新页面后重新点击报名参加"
},
"HBxXD/": {
"defaultMessage": "版权声明"
Expand Down Expand Up @@ -1546,7 +1546,7 @@
"defaultMessage": "换一批"
},
"Pq/7m5": {
"defaultMessage": "晚鸟审核中",
"defaultMessage": "晚鸟参与处理中",
"description": "type:join"
},
"PtV68+": {
Expand Down Expand Up @@ -2142,7 +2142,7 @@
"defaultMessage": "我的创作"
},
"al5/yQ": {
"defaultMessage": "晚鸟审核通过"
"defaultMessage": "晚鸟参与通过"
},
"aqX2Bt": {
"defaultMessage": "前往首页",
Expand Down Expand Up @@ -2536,7 +2536,7 @@
"description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx"
},
"jLkKbI": {
"defaultMessage": "报名审核中",
"defaultMessage": "报名处理中",
"description": "type:apply"
},
"jiB0Z2": {
Expand Down Expand Up @@ -2685,7 +2685,7 @@
"description": "src/components/Forms/CreateCircleForm/Profile.tsx"
},
"m1wKuC": {
"defaultMessage": "投稿七日书活动"
"defaultMessage": "参与七日书活动"
},
"m4GG4b": {
"defaultMessage": "删除选集"
Expand Down
10 changes: 5 additions & 5 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
"defaultMessage": "密碼"
},
"5y5rID": {
"defaultMessage": "我們將盡快審核你的申請,敬請期待活動開跑!"
"defaultMessage": "我們將盡快處理你的申請,敬請期待活動開跑!"
},
"6+eeJ4": {
"defaultMessage": "可使用小寫英文、數字及下劃線",
Expand Down Expand Up @@ -1546,7 +1546,7 @@
"defaultMessage": "換一批"
},
"Pq/7m5": {
"defaultMessage": "晚鳥審核中",
"defaultMessage": "晚鳥參與處理中",
"description": "type:join"
},
"PtV68+": {
Expand Down Expand Up @@ -2142,7 +2142,7 @@
"defaultMessage": "我的創作"
},
"al5/yQ": {
"defaultMessage": "晚鳥審核通過"
"defaultMessage": "晚鳥參與通過"
},
"aqX2Bt": {
"defaultMessage": "前往首頁",
Expand Down Expand Up @@ -2536,7 +2536,7 @@
"description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx"
},
"jLkKbI": {
"defaultMessage": "報名審核中",
"defaultMessage": "報名處理中",
"description": "type:apply"
},
"jiB0Z2": {
Expand Down Expand Up @@ -2685,7 +2685,7 @@
"description": "src/components/Forms/CreateCircleForm/Profile.tsx"
},
"m1wKuC": {
"defaultMessage": "投稿七日書活動"
"defaultMessage": "參與七日書活動"
},
"m4GG4b": {
"defaultMessage": "刪除選集"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useQuery } from '@apollo/react-hooks'
import { useContext } from 'react'

import { analytics, mergeConnections } from '~/common/utils'
Expand All @@ -7,7 +8,6 @@ import {
List,
QueryError,
SpinnerBlock,
usePublicQuery,
useRoute,
ViewerContext,
} from '~/components'
Expand All @@ -21,10 +21,10 @@ const ParticipantsDialogContent = () => {
const { getQuery } = useRoute()
const shortHash = getQuery('shortHash')

const { data, loading, error, fetchMore } =
usePublicQuery<GetParticipantsQuery>(GET_PARTICIPANTS, {
variables: { shortHash },
})
const { data, loading, error, fetchMore } = useQuery<GetParticipantsQuery>(
GET_PARTICIPANTS,
{ variables: { shortHash } }
)

// pagination
const campaign = data?.campaign
Expand Down Expand Up @@ -56,11 +56,11 @@ const ParticipantsDialogContent = () => {
return <QueryError error={error} />
}

if (!edges || edges.length <= 0 || !pageInfo) {
if (!campaign || !edges || edges.length <= 0 || !pageInfo) {
return null
}

const isViewerApplySucceeded = campaign?.application?.state === 'succeeded'
const isViewerApplySucceeded = campaign.application?.state === 'succeeded'

return (
<Dialog.Content noSpacing>
Expand Down
Loading