Skip to content

Commit ceafc60

Browse files
committed
fix: fix edit post in i.cnblogs.com
1 parent 5daa717 commit ceafc60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { commands, Uri } from 'vscode';
22
import { BlogPost } from '../models/blog-post';
3+
import { PostFileMapManager } from '../services/post-file-map';
34

45
export const openPostInBlogAdmin = (item: BlogPost | Uri) => {
56
if (!item) {
67
return;
78
}
89

9-
const postId = item instanceof BlogPost ? item.id : -1;
10+
const postId = item instanceof BlogPost ? item.id : PostFileMapManager.getPostId(item.fsPath) ?? -1;
1011

1112
commands.executeCommand('vscode.open', Uri.parse(`https://i.cnblogs.com/posts/edit;postId=${postId}`));
1213
};

0 commit comments

Comments
 (0)