diff --git a/components/organisms/completion/CompletionHeader/CompletionHeader.tsx b/components/organisms/completion/CompletionHeader/CompletionHeader.tsx index 594b837..5f49292 100644 --- a/components/organisms/completion/CompletionHeader/CompletionHeader.tsx +++ b/components/organisms/completion/CompletionHeader/CompletionHeader.tsx @@ -5,11 +5,12 @@ import Cloud from 'components/atoms/emissions/Cloud' import { useEmissionResult } from 'hooks/emission' type Props = { - category: Questions.QuestionCategory + category: Questions.QuestionCategory, + shareId?: string } const CompletionHeader: FC = (props) => { - const result = useEmissionResult(props.category) + const result = useEmissionResult(props.category, props.shareId) const total = useMemo(() => { const r = result[props.category] return r ? Math.round(r.find((m) => m.key === 'total')?.value || 0) : 0 diff --git a/pages/category/[category]/completion/[shareId].tsx b/pages/category/[category]/completion/[shareId].tsx index 863205a..ae5e20e 100644 --- a/pages/category/[category]/completion/[shareId].tsx +++ b/pages/category/[category]/completion/[shareId].tsx @@ -18,7 +18,7 @@ const CompletionPage: NextPage = ({ category, shareId }) => { return ( - + router.push(process.env.NEXT_PUBLIC_SHARE_URL ?? '/')} width="full">