Skip to content

Commit 67ea3f4

Browse files
committed
fix(save-post): fix changes not uploaded if current editor has pending changes
1 parent 70028dc commit 67ea3f4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/commands/posts-list/save-post.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export const savePostToCnblogs = async (input: Post | PostEditDto | undefined, i
135135
}
136136
let { id: postId } = post;
137137
const localFilePath = PostFileMapManager.getFilePath(postId);
138+
await saveFilePendingChanges(localFilePath);
138139
if (!isNewPost) {
139140
if (!localFilePath) {
140141
AlertService.warning('本地无该博文的编辑记录');
@@ -145,8 +146,6 @@ export const savePostToCnblogs = async (input: Post | PostEditDto | undefined, i
145146
post.title = await PostTitleSanitizer.unSanitize(post);
146147
}
147148

148-
await saveFilePendingChanges(localFilePath);
149-
150149
if (!validatePost(post)) {
151150
return false;
152151
}

0 commit comments

Comments
 (0)