fix typos and minor improvements

This commit is contained in:
Florent 2021-07-06 15:40:35 +02:00 committed by Florent F
parent 8f0390ce24
commit 3d2c6a58a2

View File

@ -98,8 +98,8 @@ export class ListenerRssAggregator extends EventEmitter {
return newListener;
}
private removeOldListener(adr: string): void {
const oldListener = this.listenerMap.get(adr);
private removeOldListener(addr: string): void {
const oldListener = this.listenerMap.get(addr);
if (!oldListener) return;
@ -108,7 +108,7 @@ export class ListenerRssAggregator extends EventEmitter {
.removeAllListeners("update")
.removeAllListeners("newEntries")
.removeAllListeners("error");
this.listenerMap.delete(adr);
this.listenerMap.delete(addr);
}
async registerListener(info: ListenerRss.Config) {
@ -118,11 +118,11 @@ export class ListenerRssAggregator extends EventEmitter {
await this.sqliteDb.insertListener(listener);
}
async unregisterListener(adr: string): Promise<void> {
if (!this.listenerMap.has(adr)) return;
async unregisterListener(addr: string): Promise<void> {
if (!this.listenerMap.has(addr)) return;
this.removeOldListener(adr);
await this.sqliteDb.deleteListener(adr);
this.removeOldListener(addr);
await this.sqliteDb.deleteListener(addr);
}
async saveOverride(expectedConfig: ListenerRss.Config[]) {