Skip to content

Commit

Permalink
fix(save-post): fix changes not uploaded if current editor has pendin…
Browse files Browse the repository at this point in the history
…g changes
  • Loading branch information
laggage committed Apr 1, 2022
1 parent 70028dc commit 67ea3f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commands/posts-list/save-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('本地无该博文的编辑记录');
Expand All @@ -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;
}
Expand Down

0 comments on commit 67ea3f4

Please sign in to comment.