feat(downloads): Download cancelling

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-21 16:46:05 +11:00
parent 18b914918c
commit 450bca9c5b
6 changed files with 44 additions and 12 deletions

View File

@ -9,7 +9,12 @@
Download game
<span v-if="progress != 0"> ({{ Math.floor(progress * 1000) / 10 }}%) </span>
</button>
</template>
<button
class="w-full rounded-md p-4 bg-blue-600 text-white"
@click="stopGameDownload"
>
Cancel game download
</button></template>
<script setup lang="ts">
import { invoke } from "@tauri-apps/api/core";
@ -36,4 +41,7 @@ async function startGameDownload() {
})();
}, 100);
}
async function stopGameDownload() {
await invoke("stop_game_download", { "gameId": gameId.value })
}
</script>