Files
hikari-desktop/src/routes/test-achievement/+page.svelte
T
naomi 27f69cb308
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 53s
CI / Lint & Test (pull_request) Failing after 7m36s
CI / Build Linux (pull_request) Has been skipped
CI / Build Windows (cross-compile) (pull_request) Has been skipped
chore: fix lints and tests
2026-01-19 19:51:10 -08:00

46 lines
1.2 KiB
Svelte

<script lang="ts">
import { testAchievementSound } from "$lib/sounds/achievement";
import { invoke } from "@tauri-apps/api/core";
async function testSound() {
testAchievementSound();
}
async function triggerAchievement() {
// This will trigger an achievement that hasn't been unlocked yet
try {
await invoke("check_achievements", {
eventType: "message_sent",
data: {},
});
} catch (error) {
console.error("Failed to trigger achievement:", error);
}
}
</script>
<div class="container mx-auto p-8">
<h1 class="text-2xl font-bold mb-6">Achievement Sound Test</h1>
<div class="space-y-4">
<button
onclick={testSound}
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors"
>
Test Achievement Sound
</button>
<button
onclick={triggerAchievement}
class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 transition-colors"
>
Trigger Test Achievement
</button>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-4">
Click the first button to test just the sound effect.<br />
Click the second button to trigger a real achievement (if any are available to unlock).
</p>
</div>
</div>