Поправки багов

This commit is contained in:
Book Pauk
2019-08-23 13:32:18 +07:00
parent 4fe5b44655
commit 086c353eff

View File

@@ -377,7 +377,8 @@ class BookManager {
this.sortedRecentCached = null; this.sortedRecentCached = null;
this.emit('recent-changed'); if (isDel)
this.emit('recent-changed');
return isDel; return isDel;
} }
@@ -385,6 +386,7 @@ class BookManager {
if (this.recentLast) { if (this.recentLast) {
return this.recentLast; return this.recentLast;
} }
const oldRecentLast = this.recentLast;
let max = 0; let max = 0;
let result = null; let result = null;
@@ -398,7 +400,8 @@ class BookManager {
this.recentLast = result; this.recentLast = result;
bmRecentStore.setItem('recent-last', this.recentLast);//no await bmRecentStore.setItem('recent-last', this.recentLast);//no await
this.emit('recent-changed'); if (this.recentLast !== oldRecentLast)
this.emit('recent-changed');
return result; return result;
} }
@@ -431,8 +434,10 @@ class BookManager {
if (this.eventListeners) { if (this.eventListeners) {
(async() => { (async() => {
await utils.sleep(1); await utils.sleep(1);
for (const listener of this.eventListeners) for (const listener of this.eventListeners) {
//console.log(eventName);
listener(eventName, value); listener(eventName, value);
}
})(); })();
} }
} }