fix: settings reset the memorized metadata.

This commit is contained in:
a.bouhuolia
2021-01-27 09:05:45 +02:00
parent 73fbb8ae99
commit 5edab0e4d6
3 changed files with 24 additions and 17 deletions

View File

@@ -201,4 +201,11 @@ export default class MetableStore implements IMetableStore{
return collection;
}
/**
* Reset the momerized metadata.
*/
resetMetadata() {
this.metadata = [];
}
}

View File

@@ -77,7 +77,7 @@ export default class MetableDBStore extends MetableStore implements IMetableStor
this.saveInserted(this.metadata),
]);
}
/**
* Saves the updated metadata.
* @param {IMetadata[]} metadata -
@@ -155,6 +155,8 @@ export default class MetableDBStore extends MetableStore implements IMetableStor
const metadata = await this.repository.all();
const mappedMetadata = this.mapMetadataCollection(metadata);
this.resetMetadata();
mappedMetadata.forEach((meta: IMetadata) => {
this.metadata.push(meta);
});