File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 428
428
},
429
429
{
430
430
"command" : " vscode-cnb.view-post-online" ,
431
- "when" : " false "
431
+ "when" : " true "
432
432
},
433
433
{
434
434
"command" : " vscode-cnb.export-post-to-pdf" ,
Original file line number Diff line number Diff line change 1
- import { commands , Uri } from 'vscode' ;
1
+ import { commands , Uri , window } from 'vscode' ;
2
2
import { Post } from '../models/post' ;
3
3
import { postService } from '../services/post.service' ;
4
4
import { PostFileMapManager } from '../services/post-file-map' ;
5
5
6
- export const viewPostOnline = async ( input : Post | Uri ) => {
6
+ export const viewPostOnline = async ( input ? : Post | Uri ) => {
7
7
let post : Post | undefined = input instanceof Post ? input : undefined ;
8
+ if ( ! input ) {
9
+ input = window . activeTextEditor ?. document . uri ;
10
+ }
8
11
if ( input instanceof Uri ) {
9
12
const postId = PostFileMapManager . getPostId ( input . fsPath ) ;
10
13
if ( postId ) {
You can’t perform that action at this time.
0 commit comments