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 d1e4ce5 commit 21efa8dCopy full SHA for 21efa8d
src/cmd/open/os-open-local-post-file.ts
@@ -2,10 +2,15 @@ import { Uri } from 'vscode'
2
import { execCmd } from '@/infra/cmd'
3
import { Post } from '@/model/post'
4
import { PostFileMapManager } from '@/service/post/post-file-map'
5
+import { PostTreeItem } from '@/tree-view/model/post-tree-item'
6
-export function osOpenLocalPostFile(post?: Post) {
7
- if (post === undefined) return
+export function osOpenLocalPostFile(post?: Post | PostTreeItem) {
8
+ if (post === undefined) {
9
+ console.error('post is undefined in osOpenLocalPostFile')
10
+ return
11
+ }
12
13
+ post = post instanceof PostTreeItem ? post.post : post
14
const postFilePath = PostFileMapManager.getFilePath(post.id)
15
if (postFilePath === undefined) return
16
0 commit comments