Added better is logging function

This commit is contained in:
2026-02-09 18:28:01 +01:00
parent fbb54b461e
commit 4ad48d4ecc
4 changed files with 39 additions and 46 deletions

View File

@@ -55,6 +55,12 @@
}
}
function handleKeydown(event) {
if (event.ctrlKey && event.key === 's') {
saveCharacterData();
}
}
async function saveCharacterData() {
const res = await fetch(`${API_BASE}/api/shadowrun/characters_data/${currentCharacter.id}`, {
method: 'POST',
@@ -67,6 +73,8 @@
let inventory = currentCharacter?.inventory || [];
</script>
<svelte:window on:keydown={handleKeydown} />
<h1>Name: {currentCharacter.name}</h1>
<h2>Character Info</h2>