We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5daa717 commit ceafc60Copy full SHA for ceafc60
src/commands/open-post-in-blog-admin.ts
@@ -1,12 +1,13 @@
1
import { commands, Uri } from 'vscode';
2
import { BlogPost } from '../models/blog-post';
3
+import { PostFileMapManager } from '../services/post-file-map';
4
5
export const openPostInBlogAdmin = (item: BlogPost | Uri) => {
6
if (!item) {
7
return;
8
}
9
- const postId = item instanceof BlogPost ? item.id : -1;
10
+ const postId = item instanceof BlogPost ? item.id : PostFileMapManager.getPostId(item.fsPath) ?? -1;
11
12
commands.executeCommand('vscode.open', Uri.parse(`https://i.cnblogs.com/posts/edit;postId=${postId}`));
13
};
0 commit comments