my own take on some BASED design decisions

This commit is contained in:
DecDuck
2024-10-24 22:05:58 +11:00
parent 10c8344930
commit 5ed0833e61
11 changed files with 130 additions and 143 deletions

View File

@ -1,25 +1,38 @@
<template>
<button class="w-full rounded-md p-4 bg-blue-600 text-white" @click="requestGameWrapper">
<button
class="w-full rounded-md p-4 bg-blue-600 text-white"
@click="requestGameWrapper"
>
Load Data
</button>
<button class="w-full rounded-md p-4 bg-blue-600 text-white" @click="requestGameWrapper">
<input placeholder="GAME ID" v-model="gameId" />
<input placehodler="VERSION NAME" v-model="versionName" />
<button
class="w-full rounded-md p-4 bg-blue-600 text-white"
@click="requestGameWrapper"
>
Download Game
</button>
</template>
<script setup lang="ts">
import { invoke } from "@tauri-apps/api/core";
const gameId = ref("");
const versionName = ref("");
async function requestGame() {
console.log("Requested game from FE");
await invoke("start_game_download", { gameId: "328a276d-4777-4a47-97f1-15069c1e5f66", gameVersion: "1.11.2", maxThreads: 4 });
await invoke("start_game_download", {
gameId: gameId.value,
gameVersion: versionName.value,
maxThreads: 4,
});
}
function requestGameWrapper() {
console.log("Wrapper started");
requestGame()
.then(() => {})
.catch((e) => {
console.log(e);
})
.then(() => {})
.catch((e) => {
console.log(e);
});
}
</script>