Skip to content

Commit

Permalink
fix: notice editor
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Feb 8, 2024
1 parent 4d273c7 commit a6c2f60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const GameNoticeEditCard: FC<GameNoticeEditCardProps> = ({
<Card {...props} shadow="sm" p="sm">
<Group position="apart" noWrap>
<Stack spacing={1}>
<InlineMarkdownRender source={gameNotice.content} />
<InlineMarkdownRender source={gameNotice.values.at(-1) || ''} />
<Text size="xs" fw={700} c="dimmed">
{dayjs(gameNotice.time).format('#YY/MM/DD HH:mm:ss')}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const GameNoticeEditModal: FC<GameNoticeEditModalProps> = (props) => {
const numId = parseInt(id ?? '-1')
const { gameNotice, mutateGameNotice, ...modalProps } = props

const [content, setContent] = useState<string>(gameNotice?.content || '')
const [content, setContent] = useState<string>(gameNotice?.values.at(-1) || '')
const [disabled, setDisabled] = useState(false)
const { t } = useTranslation()

useEffect(() => {
setContent(gameNotice?.content || '')
setContent(gameNotice?.values.at(-1) || '')
}, [gameNotice])

const onConfirm = () => {
Expand All @@ -35,7 +35,7 @@ const GameNoticeEditModal: FC<GameNoticeEditModalProps> = (props) => {
})
return
}
if (content === gameNotice?.content) {
if (content === gameNotice?.values.at(-1)) {
showNotification({
color: 'orange',
message: t('common.error.no_change'),
Expand Down

0 comments on commit a6c2f60

Please sign in to comment.