mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 00:02:41 +10:00
Lesson learned: Wrappers are the bane of my existence. Also here's the download cancelling logic.
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -9,10 +9,16 @@
|
||||
<input placeholder="VERSION NAME" v-model="versionName" />
|
||||
<button
|
||||
class="w-full rounded-md p-4 bg-blue-600 text-white"
|
||||
@click="startGameDownloads"
|
||||
@click="startGameDownloadsWrapper"
|
||||
>
|
||||
Start Game Downloads
|
||||
</button>
|
||||
<button
|
||||
class="w-full rounded-md p-4 bg-blue-600 text-white"
|
||||
@click="cancelGameDownloadWrapper"
|
||||
>
|
||||
Cancel game download
|
||||
</button>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
@ -39,6 +45,7 @@ function queueGameWrapper() {
|
||||
async function startGameDownloads() {
|
||||
console.log("Downloading Games");
|
||||
await invoke("start_game_downloads", { maxThreads: 4 })
|
||||
console.log("Finished downloading games");
|
||||
}
|
||||
function startGameDownloadsWrapper() {
|
||||
startGameDownloads()
|
||||
@ -47,4 +54,16 @@ function startGameDownloadsWrapper() {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
async function cancelGameDownload() {
|
||||
console.log("Cancelling game download");
|
||||
await invoke("stop_specific_game_download", { gameId: gameId.value })
|
||||
}
|
||||
function cancelGameDownloadWrapper() {
|
||||
console.log("Triggered game cancel wrapper");
|
||||
cancelGameDownload()
|
||||
.then(() => {})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user