Skip to content

Commit 952141c

Browse files
committed
simplify code
1 parent 72ba303 commit 952141c

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/components/round/TechCardDraft.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,10 @@ export default defineComponent({
157157
if (this.draftingCompleted) {
158158
return
159159
}
160-
if (this.botMarkerPlaced < this.playerMarkerPlaced) {
160+
if (this.roundData.startPlayer == Player.BOT) {
161161
await this.nextTurnBot()
162-
await this.nextTurn()
163-
}
164-
else if (this.playerMarkerPlaced < this.botMarkerPlaced) {
165162
await this.nextTurnPlayer()
166163
}
167-
else if (this.roundData.startPlayer == Player.BOT) {
168-
await this.nextTurnBot()
169-
await this.nextTurn()
170-
}
171164
else {
172165
await this.nextTurnPlayer()
173166
}

src/util/NavigationState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export default class NavigationState {
5353
}
5454

5555
private getLastDraftStep() : TechDraftStep | undefined {
56-
const techDraftSteps = (this.roundData.techDraftSteps?.toSorted((a, b) => a.step - b.step) ?? [])
56+
return (this.roundData.techDraftSteps?.toSorted((a, b) => a.step - b.step) ?? [])
5757
.filter(item => item.step < this.draftingStep || this.draftingStep == 0)
58-
return techDraftSteps[techDraftSteps.length - 1]
58+
.at(-1)
5959
}
6060

6161
private getTechCardSelectionPersistence() : TechCardSelectionPersistence {

0 commit comments

Comments
 (0)