Fix gamelog notify being triggered from old logs being removed

This commit is contained in:
Natsumi
2021-01-20 01:51:12 +13:00
parent 9058da08b0
commit af2897947e
+7 -4
View File
@@ -4639,7 +4639,7 @@ speechSynthesis.getVoices();
$app.data.gameLogTable = { $app.data.gameLogTable = {
data: [], data: [],
lastRunLength: 0, lastEntryDate: '',
filters: [ filters: [
{ {
prop: 'type', prop: 'type',
@@ -4683,10 +4683,13 @@ speechSynthesis.getVoices();
if (API.isLoggedIn === true) { if (API.isLoggedIn === true) {
await this.updateGameLog(); await this.updateGameLog();
this.sweepGameLog(); this.sweepGameLog();
if (this.gameLogTable.data.length !== this.gameLogTable.lastRunLength) { var length = this.gameLogTable.data.length;
this.notifyMenu('gameLog'); if (length > 0) {
if (this.gameLogTable.data[length - 1].created_at !== this.gameLogTable.lastEntryDate) {
this.notifyMenu('gameLog');
}
this.gameLogTable.lastEntryDate = this.gameLogTable.data[length - 1].created_at;
} }
this.gameLogTable.lastRunLength = this.gameLogTable.data.length;
this.updateSharedFeed(); this.updateSharedFeed();
} }
} catch (err) { } catch (err) {