fix: post editor editing status not updated

This commit is contained in:
DIYgod 2024-02-20 00:54:15 +08:00
parent c4126c9589
commit c0931b2d93
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -141,7 +141,8 @@ export default function PostEditor() {
const updateValue = useCallback(
(val: EditorValues) => {
if (visibility !== PageVisibilityEnum.Draft) {
const _visibility = getPageVisibility(page.data || undefined) // can't get the correct visibility here, very strange
if (_visibility !== PageVisibilityEnum.Draft) {
setVisibility(PageVisibilityEnum.Modified)
}
@ -176,7 +177,7 @@ export default function PostEditor() {
}
useEditorState.setState(newValues)
},
[visibility, site.data?.characterId, type, queryClient],
[visibility, site.data?.characterId, type, queryClient, page.data],
)
const isMobileLayout = useIsMobileLayout()