Skip to content

Commit 59ebbcb

Browse files
committed
[feature] Hide accept button for possible goal after its accepted
1 parent 6e17614 commit 59ebbcb

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/components/game-events/CurrentEvents.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Submitted by: {{gameEvent.origins}}
1717
</p>
1818
<div class="btn-accept"
19-
v-if="gameEvent.type === 'possibleGoal'"
19+
v-if="showAcceptGoal(gameEvent)"
2020
v-b-tooltip.hover.righttop="'Accept this goal'">
2121
<a @click="acceptGoal(gameEvent)">
2222
<font-awesome-icon icon="check-circle" class="fa-lg"></font-awesome-icon>
@@ -38,9 +38,20 @@
3838
},
3939
gameEventsPresent() {
4040
return this.gameEvents != null && this.gameEvents.length > 0;
41+
},
42+
goalEventPresent() {
43+
for (let event of this.state.gameEvents) {
44+
if (event.type === 'goal') {
45+
return true;
46+
}
47+
}
48+
return false;
4149
}
4250
},
4351
methods: {
52+
showAcceptGoal(gameEvent) {
53+
return !this.goalEventPresent && gameEvent.type === 'possibleGoal';
54+
},
4455
details(gameEvent) {
4556
let key = Object.keys(gameEvent.details)[0];
4657
return gameEvent.details[key];
@@ -91,11 +102,14 @@
91102
text-align: left;
92103
}
93104
94-
.details-row {
95-
margin-bottom: 0;
105+
.btn-accept {
106+
position: absolute;
107+
right: 0;
108+
bottom: 0;
109+
margin: 0.3em;
96110
}
97111
98-
.btn-accept {
99-
margin: 0.1em;
112+
.details-row {
113+
margin-bottom: 0;
100114
}
101115
</style>

0 commit comments

Comments
 (0)