Skip to content

Commit

Permalink
Merge pull request #403 from gsainfoteam/402-공지-수정시에-추가-공지가-같이-작성-됨
Browse files Browse the repository at this point in the history
🐛 Fix empty addi-notice generated when modify
  • Loading branch information
dohyun-ko authored Nov 23, 2024
2 parents f310078 + ef191c8 commit 34d589c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/app/[lng]/write/EditableTimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const EditableTimer = ({
}, 1000);

return () => clearInterval(interval);
}, []);
}, [createdAt]);

const isEditable = timeRemaining.minutes > 0 && timeRemaining.seconds > 0;
const isEditable = timeRemaining.minutes > 0 && timeRemaining.seconds >= 0;

return (
<p
Expand All @@ -45,7 +45,10 @@ const EditableTimer = ({
<>
{t('write.editableTimer')}{' '}
<span className={'font-bold'}>
{`${timeRemaining.minutes}:${timeRemaining.seconds}`}
{`${timeRemaining.minutes}:${String(timeRemaining.seconds).padStart(
2,
'0',
)}`}
</span>
</>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/app/[lng]/write/NoticeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const NoticeEditor = ({
}
}

const isAdditionalAttached = state.korean.additionalContent !== undefined;
const isAdditionalAttached = !!state.korean.additionalContent;

if (isAdditionalAttached) {
const additionalKoreanNotice = await createAdditionalNotice({
Expand Down

0 comments on commit 34d589c

Please sign in to comment.