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 428428 },
429429 {
430430 "command" : " vscode-cnb.view-post-online" ,
431- "when" : " false "
431+ "when" : " true "
432432 },
433433 {
434434 "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' ;
22import { Post } from '../models/post' ;
33import { postService } from '../services/post.service' ;
44import { PostFileMapManager } from '../services/post-file-map' ;
55
6- export const viewPostOnline = async ( input : Post | Uri ) => {
6+ export const viewPostOnline = async ( input ? : Post | Uri ) => {
77 let post : Post | undefined = input instanceof Post ? input : undefined ;
8+ if ( ! input ) {
9+ input = window . activeTextEditor ?. document . uri ;
10+ }
811 if ( input instanceof Uri ) {
912 const postId = PostFileMapManager . getPostId ( input . fsPath ) ;
1013 if ( postId ) {
You can’t perform that action at this time.
0 commit comments