diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..3652cd0 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,20 @@ +name: build +on: [push, workflow_dispatch] + +jobs: + build-test: + runs-on: docker + container: node:20-bookworm + timeout-minutes: 15 + steps: + - name: Checkout + run: git clone --depth 1 ${{ github.server_url }}/${{ github.repository }}.git . + + - name: Install + run: npm ci || npm install + + - name: Build + run: npm run build + + - name: Test + run: npm test --if-present diff --git a/src/App.vue b/src/App.vue index 230e188..d4ea9af 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ interface Character { } interface ShopItem { id: string; name: string; type: string; quality: string; slot: string - stats: ItemStat; attack_type?: string; price: number + stats: ItemStat; attack_type?: string; value: number } interface ItemStat { [key: string]: number } interface Item { @@ -149,8 +149,8 @@ function xpForLevel(level: number): number { const MAX_LEVEL = 100 -function nextLevel() { - if (!selectedChar.value) return +function nextLevel(): number { + if (!selectedChar.value) return 1 const current = selectedChar.value.level return current + 1 } @@ -452,7 +452,7 @@ async function sellItem(itemId: string) { body: JSON.stringify({ action: 'sell', item_id: itemId }), }) if (!res.ok) { error.value = (await res.text()) || 'Cannot sell'; selling.value = null; return } - const result = await res.json() + await res.json() const charsRes = await apiFetch(`/api/users/${selectedUser.value!.id}/characters`) characters.value = await charsRes.json() selectedChar.value = characters.value.find(c => c.id === selectedChar.value!.id) ?? null @@ -644,7 +644,7 @@ async function activateSpell(spellId: string | null) {