From dfc59e1d6565949ce06b8cb098c3348efea3b781 Mon Sep 17 00:00:00 2001 From: Rens Hamburger Date: Sun, 3 Nov 2019 09:17:23 +0100 Subject: [PATCH] FIxes --- src/components/BlockPanel.vue | 1 + src/helpers/Crew.js | 2 +- src/services/ResultService.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/BlockPanel.vue b/src/components/BlockPanel.vue index 2f498e2..0263c6a 100644 --- a/src/components/BlockPanel.vue +++ b/src/components/BlockPanel.vue @@ -90,6 +90,7 @@ const blocks = await this.resultService.update(); this.updateFields(blocks); } catch (e) { + console.log(e); this.updateFields(this.resultService.getLastRegattaData()); return false; } diff --git a/src/helpers/Crew.js b/src/helpers/Crew.js index 3b95546..4ef64d4 100644 --- a/src/helpers/Crew.js +++ b/src/helpers/Crew.js @@ -35,7 +35,7 @@ export class Crew { return ''; } } - if (pathElements[0] === 'times') { + if (pathElements[0] === 'time') { return Crew.formatTime(element); } return element; diff --git a/src/services/ResultService.js b/src/services/ResultService.js index 32a7fcd..2ffc58b 100644 --- a/src/services/ResultService.js +++ b/src/services/ResultService.js @@ -105,13 +105,13 @@ export class ResultService extends Service { if (count + block.crewCount > this.beginCount && count < this.endCount) { this.fields.push(block); this.fields[this.fields.length - 1].forEach(field => { - if (fieldCount + count > this.endCount && field.crewCount) { + if ((fieldCount + count > this.endCount) && field.crewCount) { field.crews.teams.length = 0; } if (count < this.beginCount) { - if (count + field.crewCount > this.beginCount) { + if ((count + field.crewCount > this.beginCount) && field.crewCount) { field.crews.teams.splice(0, this.beginCount - count); - } else { + } else if (field.crewCount) { field.crews.teams.length = 0; field.crewCount = 0; }