Merge pull request #71 from THeK3nger/master
Delete history for deleted files
This commit is contained in:
commit
76ac1fbc86
1 changed files with 11 additions and 3 deletions
|
@ -25,9 +25,17 @@ export default class StatsManager {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.vault.on("rename", (new_name, old_path) => {
|
this.vault.on("rename", (new_name, old_path) => {
|
||||||
const content = this.vaultStats.modifiedFiles[old_path];
|
if (this.vaultStats.modifiedFiles.hasOwnProperty(old_path)) {
|
||||||
delete this.vaultStats.modifiedFiles[old_path];
|
const content = this.vaultStats.modifiedFiles[old_path];
|
||||||
this.vaultStats.modifiedFiles[new_name.path] = content;
|
delete this.vaultStats.modifiedFiles[old_path];
|
||||||
|
this.vaultStats.modifiedFiles[new_name.path] = content;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.vault.on("delete", (deleted_file) => {
|
||||||
|
if (this.vaultStats.modifiedFiles.hasOwnProperty(deleted_file.path)) {
|
||||||
|
delete this.vaultStats.modifiedFiles[deleted_file.path];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.vault.adapter.exists(STATS_FILE).then(async (exists) => {
|
this.vault.adapter.exists(STATS_FILE).then(async (exists) => {
|
||||||
|
|
Loading…
Reference in a new issue