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/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; }