File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 44 Plugin ,
55 PluginSettingTab ,
66 Setting ,
7+ debounce ,
78 TFile ,
89} from "obsidian" ;
910import type moment from "moment" ;
@@ -38,7 +39,11 @@ export default class Changelog extends Plugin {
3839 hotkeys : [ ] ,
3940 } ) ;
4041
41- this . watchVaultChange = this . watchVaultChange . bind ( this ) ;
42+ this . watchVaultChange = debounce (
43+ this . watchVaultChange . bind ( this ) ,
44+ 200 ,
45+ false
46+ ) ;
4247 this . registerWatchVaultEvents ( ) ;
4348 }
4449
@@ -54,11 +59,11 @@ export default class Changelog extends Plugin {
5459 }
5560 }
5661
57- async watchVaultChange ( file : any ) {
62+ watchVaultChange ( file : any ) {
5863 if ( file . path === this . settings . changelogFilePath ) {
5964 return ;
6065 } else {
61- await this . writeChangelog ( ) ;
66+ this . writeChangelog ( ) ;
6267 }
6368 }
6469
You can’t perform that action at this time.
0 commit comments