Skip to content

Commit

Permalink
modify: add NonExistContainer with GQL Error
Browse files Browse the repository at this point in the history
  • Loading branch information
zinirun committed Mar 9, 2021
1 parent 44bf9a6 commit 5f69899
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions frontend/src/do/pages/DoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import SubmittedContainer from '../containers/SubmittedContainer';
import '../static/style.css';
import { isMobile } from 'react-device-detect';
import { useDarkreader } from 'react-darkreader';
import NonExistContainer from '../containers/NonExistContainer';

export default function DoPage(props) {
const { pubUrl } = props.match.params;
Expand Down Expand Up @@ -54,7 +55,10 @@ export default function DoPage(props) {
if (!isMobile && status !== 'closed')
message.info(`키보드만을 이용해서 답변할 수 있습니다.`);
}
}, [data]);
if (error) {
setStatus('404');
}
}, [data, error]);

const handleAnswerDone = useCallback(checkAnswerHandler, []);

Expand Down Expand Up @@ -111,10 +115,6 @@ export default function DoPage(props) {
setStatus('progress');
}, []);

if (error) {
props.history.push('/?404form');
}

return (
<div
style={{
Expand All @@ -125,6 +125,7 @@ export default function DoPage(props) {
<ScrollToTopOnMount />
<FixedLogo />
{loading && <LoadingSpin />}
{status === '404' && <NonExistContainer />}
{status === 'start' &&
form &&
(form.status === 'open' ? (
Expand Down

0 comments on commit 5f69899

Please sign in to comment.