@@ -187,25 +187,28 @@ export default class InvioPlugin extends Plugin {
187
187
async getLocalFileStatus ( ) {
188
188
const isWatched = ( p : string ) => {
189
189
const pF = new Path ( p )
190
- pF . isInsideDir ( this . settings . localWatchDir ) &&
191
- ! pF . isInsideDir ( RemoteConflictPrefix ) &&
192
- ! pF . isInsideDir ( LocalConflictPrefix ) &&
190
+ if ( p . endsWith ( '/' ) ) {
191
+ return pF . isInsideDir ( this . settings . localWatchDir ) &&
192
+ ! pF . isInsideDir ( this . settings . localWatchDir + '/' + RemoteConflictPrefix ) &&
193
+ ! pF . isInsideDir ( this . settings . localWatchDir + '/' + LocalConflictPrefix ) &&
194
+ ! ( pF . asString === ( this . settings . localWatchDir + '/' + RemoteConflictPrefix ) ) &&
195
+ ! ( pF . asString === ( this . settings . localWatchDir + '/' + LocalConflictPrefix ) )
196
+ }
197
+ return pF . isInsideDir ( this . settings . localWatchDir ) &&
198
+ ! pF . isInsideDir ( this . settings . localWatchDir + '/' + RemoteConflictPrefix ) &&
199
+ ! pF . isInsideDir ( this . settings . localWatchDir + '/' + LocalConflictPrefix ) &&
193
200
! p . endsWith ( '.conflict.md' )
194
201
}
195
202
// this.app.vault.getAllLoadedFiles
196
203
// TODO: List only concerned files, only source of truth
197
204
// *.conflict.md files is for data backup when conflicts happened
198
- const local = this . app . vault . getMarkdownFiles ( ) . filter ( file => {
199
- return isWatched ( file . path )
200
- } ) ;
205
+ const local = this . app . vault . getMarkdownFiles ( ) . filter ( file => isWatched ( file . path ) ) ;
201
206
log . info ( 'local file path list: ' , local ) ;
202
207
// const local = this.app.vault.getAllLoadedFiles();
203
208
const localHistory = ( await loadFileHistoryTableByVault (
204
209
this . db ,
205
210
this . vaultRandomID
206
- ) ) . filter ( item => {
207
- return isWatched ( item . key )
208
- } )
211
+ ) ) . filter ( item => isWatched ( item . key ) )
209
212
let localConfigDirContents : ObsConfigDirFileType [ ] = undefined ;
210
213
if ( this . settings . syncConfigDir ) {
211
214
localConfigDirContents = await listFilesInObsFolder (
0 commit comments