@@ -155,6 +155,15 @@ export default class InvioPlugin extends Plugin {
155
155
if ( file . extension !== 'md' ) {
156
156
return false ;
157
157
}
158
+ if ( file . path . endsWith ( '.conflict.md' ) ) {
159
+ return false ;
160
+ }
161
+ if ( file . path . split ( '/' ) [ 1 ] === RemoteConflictPrefix ) {
162
+ return false ;
163
+ }
164
+ if ( file . path . split ( '/' ) [ 1 ] === LocalConflictPrefix ) {
165
+ return false ;
166
+ }
158
167
return true ;
159
168
} ;
160
169
@@ -176,22 +185,27 @@ export default class InvioPlugin extends Plugin {
176
185
}
177
186
178
187
async getLocalFileStatus ( ) {
188
+ const isWatched = ( p : string ) => {
189
+ const pF = new Path ( p )
190
+ pF . isInsideDir ( this . settings . localWatchDir ) &&
191
+ ! pF . isInsideDir ( RemoteConflictPrefix ) &&
192
+ ! pF . isInsideDir ( LocalConflictPrefix ) &&
193
+ ! p . endsWith ( '.conflict.md' )
194
+ }
179
195
// this.app.vault.getAllLoadedFiles
180
196
// TODO: List only concerned files, only source of truth
181
197
// *.conflict.md files is for data backup when conflicts happened
182
198
const local = this . app . vault . getMarkdownFiles ( ) . filter ( file => {
183
- const p = new Path ( file . path ) ;
184
- return p . isInsideDir ( this . settings . localWatchDir ) &&
185
- ! p . isInsideDir ( RemoteConflictPrefix ) &&
186
- ! p . isInsideDir ( LocalConflictPrefix ) &&
187
- ! file . path . endsWith ( '.conflict.md' )
199
+ return isWatched ( file . path )
188
200
} ) ;
189
201
log . info ( 'local file path list: ' , local ) ;
190
202
// const local = this.app.vault.getAllLoadedFiles();
191
- const localHistory = await loadFileHistoryTableByVault (
203
+ const localHistory = ( await loadFileHistoryTableByVault (
192
204
this . db ,
193
205
this . vaultRandomID
194
- ) ;
206
+ ) ) . filter ( item => {
207
+ return isWatched ( item . key )
208
+ } )
195
209
let localConfigDirContents : ObsConfigDirFileType [ ] = undefined ;
196
210
if ( this . settings . syncConfigDir ) {
197
211
localConfigDirContents = await listFilesInObsFolder (
0 commit comments