File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { revealPostListItem } from '@/service/post/post-list-view'
99import { PostTreeItem } from '@/tree-view/model/post-tree-item'
1010import { MarkdownCfg } from '@/ctx/cfg/markdown'
1111import { fsUtil } from '@/infra/fs/fsUtil'
12- import { WorkspaceCfg } from '@/ctx/cfg/workspace'
1312
1413export async function postPull ( input : Post | PostTreeItem | Uri | undefined | null , showConfirm = true , mute = false ) {
1514 const ctxList : CmdCtx [ ] = [ ]
@@ -18,11 +17,7 @@ export async function postPull(input: Post | PostTreeItem | Uri | undefined | nu
1817 if ( parsePostInput ( input ) && input . id > 0 ) {
1918 const post = input
2019 const path = PostFileMapManager . getFilePath ( post . id )
21- if (
22- path === undefined ||
23- ! ( await fsUtil . exists ( path ) ) ||
24- path . indexOf ( WorkspaceCfg . getWorkspaceUri ( ) . fsPath ) < 0
25- ) {
20+ if ( path === undefined || ! ( await fsUtil . exists ( path ) ) ) {
2621 isFreshPull = true
2722 const uri = buildLocalPostFileUri ( post , false )
2823 await workspace . fs . writeFile ( uri , Buffer . from ( post . postBody ) )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { postCategoryDataProvider } from '@/tree-view/provider/post-category-tre
22import { postDataProvider } from '@/tree-view/provider/post-data-provider'
33import { LocalState } from '@/ctx/local-state'
44import { Uri } from 'vscode'
5+ import { WorkspaceCfg } from '@/ctx/cfg/workspace'
56
67const validatePostFileMap = ( map : PostFileMap ) => map [ 0 ] >= 0 && map [ 1 ] !== ''
78
@@ -69,6 +70,7 @@ export namespace PostFileMapManager {
6970 if ( map === undefined ) return
7071 const path = map [ 1 ]
7172 if ( path === '' ) return
73+ if ( path . indexOf ( WorkspaceCfg . getWorkspaceUri ( ) . path ) < 0 ) return
7274 return path . startsWith ( '/' ) ? Uri . parse ( path ) . fsPath : path
7375 }
7476
You can’t perform that action at this time.
0 commit comments