try for better ocr puzzle

This commit is contained in:
2025-10-30 14:29:50 +01:00
parent 8960f551e6
commit 15de496501
15 changed files with 649 additions and 88 deletions
+6 -3
View File
@@ -181,6 +181,7 @@
<script setup lang="ts">
import { ref, watch, nextTick } from 'vue'
import { ocrService } from '../services/ocrService'
import { usePuzzlesStore } from '@/stores/puzzles'
import type { SubmissionFile, SteamCollectionItem } from '@/types'
interface Props {
@@ -195,6 +196,9 @@ interface Emits {
const props = defineProps<Props>()
const emit = defineEmits<Emits>()
// Pinia store
const puzzlesStore = usePuzzlesStore()
const fileInput = ref<HTMLInputElement>()
const isDragOver = ref(false)
const error = ref('')
@@ -211,10 +215,9 @@ watch(files, (newFiles) => {
}, { deep: true })
// Watch for puzzle changes and update OCR service
watch(() => props.puzzles, (newPuzzles) => {
watch(() => puzzlesStore.puzzles, (newPuzzles) => {
if (newPuzzles && newPuzzles.length > 0) {
const puzzleNames = newPuzzles.map(puzzle => puzzle.title)
ocrService.setAvailablePuzzleNames(puzzleNames)
ocrService.setAvailablePuzzleNames(puzzlesStore.puzzleNames)
}
}, { immediate: true })