-
+ :disabled="disabledMap[source.id]" :index="index" />
@@ -36,7 +36,8 @@ const sources = round.sources as Sources
const { saveSelection } = useEngine()
const selection = ref('')
-const selectable = computed(() => game.phase === 'select-quote' && !selection.value && !round.selections[useUserinfoStore().id])
+const { id } = useUserinfoStore()
+const selectable = computed(() => game.phase === 'select-quote' && !selection.value && !round.selections[id])
const selectSource = async (source: Source): Promise => {
if (selectable.value) {
await saveSelection(source.id)
@@ -50,7 +51,7 @@ const showSources = computed(() => ['select-quote', 'reveal-show-count', 'reveal
const showQuote = showSources
const showSkipButton = computed(() => game.phase === 'select-quote')
const badgeMap = computed(() => {
- const badgeMap = {}
+ const badgeMap = {} as { [key: string]: number}
if (game.phase === 'reveal-show-count') {
for (const id in round.revelation.votes) {
badgeMap[id] = round.revelation.votes[id].length
@@ -60,7 +61,7 @@ const badgeMap = computed(() => {
})
const disabledMap = computed(() => {
- const disabledMap = {}
+ const disabledMap = {} as { [key: string]: boolean}
if (game.phase === 'reveal-source') {
for (const id in round.revelation.sources) {
disabledMap[id] = !round.revelation.sources[id]
diff --git a/client/src/components/SourceCard.vue b/client/src/components/SourceCard.vue
index 8dbac07..f1c522c 100644
--- a/client/src/components/SourceCard.vue
+++ b/client/src/components/SourceCard.vue
@@ -15,6 +15,7 @@ import type { Source } from '@/composables/engine.d'
const props = defineProps<{
source: Source,
+ index: number,
selectable?: boolean,
selected?: boolean,
badge?: number,
diff --git a/client/src/composables/engine.d.ts b/client/src/composables/engine.d.ts
index 52bd7bb..81db37c 100644
--- a/client/src/composables/engine.d.ts
+++ b/client/src/composables/engine.d.ts
@@ -35,12 +35,10 @@ export type Source = {
export type Sources = Array