diff --git a/package.json b/package.json index beee744..d9bc563 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "type": "module", "name": "skyline-overlay", - "version": "3.4.0", + "version": "3.4.1", "description": "A modern customizable horizon FFXIV miniparse overlay.", "license": "Apache-2.0", "author": "DSRKafuU (https://dsrkafuu.net)", diff --git a/src/store/modules/API.ts b/src/store/modules/API.ts index 45f47d6..c356012 100644 --- a/src/store/modules/API.ts +++ b/src/store/modules/API.ts @@ -98,8 +98,16 @@ class API { // if last data (false) this data (true) which indicates a new battle, // push last data (false) into a new history if (lastData && !lastData.isActive && payload.isActive) { - this.historys.length >= 5 && this.historys.pop(); - this.historys.unshift({ time: Date.now(), ...lastData }); + // extra validation before push, + // do not push empty battle into history + if ( + lastData.encounter.duration !== '00:00' && + lastData.encounter.durationSeconds !== 0 && + lastData.encounter.dps !== 0 + ) { + this.historys.length >= 5 && this.historys.pop(); + this.historys.unshift({ time: Date.now(), ...lastData }); + } } // record data for future use lastData = cloneDeep(payload);