diff --git a/src/commands/posts-list/save-post.ts b/src/commands/posts-list/save-post.ts index 032a1e8b..37394e2b 100644 --- a/src/commands/posts-list/save-post.ts +++ b/src/commands/posts-list/save-post.ts @@ -135,6 +135,7 @@ export const savePostToCnblogs = async (input: Post | PostEditDto | undefined, i } let { id: postId } = post; const localFilePath = PostFileMapManager.getFilePath(postId); + await saveFilePendingChanges(localFilePath); if (!isNewPost) { if (!localFilePath) { AlertService.warning('本地无该博文的编辑记录'); @@ -145,8 +146,6 @@ export const savePostToCnblogs = async (input: Post | PostEditDto | undefined, i post.title = await PostTitleSanitizer.unSanitize(post); } - await saveFilePendingChanges(localFilePath); - if (!validatePost(post)) { return false; }