From af2897947e9291fc96d74cd33b2c775d65042c74 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 20 Jan 2021 01:51:12 +1300 Subject: [PATCH] Fix gamelog notify being triggered from old logs being removed --- html/src/app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index bfa18011..4d13d003 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -4639,7 +4639,7 @@ speechSynthesis.getVoices(); $app.data.gameLogTable = { data: [], - lastRunLength: 0, + lastEntryDate: '', filters: [ { prop: 'type', @@ -4683,10 +4683,13 @@ speechSynthesis.getVoices(); if (API.isLoggedIn === true) { await this.updateGameLog(); this.sweepGameLog(); - if (this.gameLogTable.data.length !== this.gameLogTable.lastRunLength) { - this.notifyMenu('gameLog'); + var length = this.gameLogTable.data.length; + 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(); } } catch (err) {