Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b05cba25f | ||
| 14e001cae6 |
@@ -83,3 +83,8 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* FRO-23 Create Player Hand Component ([#15](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/15)) ([b20ec0a](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/b20ec0a3638649155f2f9c5984014d75eb2ba618))
|
* FRO-23 Create Player Hand Component ([#15](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/15)) ([b20ec0a](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/b20ec0a3638649155f2f9c5984014d75eb2ba618))
|
||||||
|
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.8.0...0.0.0) (2025-12-10)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **api:** FRO-15 Join Game ([#16](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/16)) ([14e001c](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/14e001cae67592c5ea15786905aa3574df9a9e6c))
|
||||||
|
|||||||
@@ -2,27 +2,37 @@
|
|||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import {useQuasar} from "quasar";
|
import {useQuasar} from "quasar";
|
||||||
|
import axios from "axios";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const lobbyCode = ref('');
|
const lobbyCode = ref('');
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
const api = window?.__RUNTIME_CONFIG__?.API_URL;
|
||||||
const startGameQuasar = async() => {
|
const startGameQuasar = async() => {
|
||||||
if (!lobbyCode.value) {
|
if (!lobbyCode.value) {
|
||||||
$q.notify({ message: 'Lobby-Name wird benötigt', color: 'red', position: 'top', icon: 'cancel' });
|
$q.notify({ message: 'Lobby-Name wird benötigt', color: 'red', position: 'top', icon: 'cancel' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
//TODO: Implement Logic to Start the Game and Redirect to Ingame
|
axios.post(`${api}/joinGame`, {gameId: lobbyCode.value.toString()}, {withCredentials: true}).then(response => {
|
||||||
await delay(3000)
|
const responseData = response.data
|
||||||
isLoading.value = false;
|
|
||||||
$q.notify({
|
$q.notify({
|
||||||
message: `Lobby "${lobbyCode.value}" erfolgreich gefunden`,
|
message: `Lobby "${lobbyCode.value}" erfolgreich gefunden`,
|
||||||
color: 'green-6',
|
color: 'green-6',
|
||||||
icon: 'check_circle',
|
icon: 'check_circle',
|
||||||
position: 'top'
|
position: 'top'
|
||||||
});
|
});
|
||||||
router.push({ name: 'mainmenu'});
|
router.push("/lobby")
|
||||||
|
}).catch(() => {
|
||||||
|
$q.notify({
|
||||||
|
message: `Lobby "${lobbyCode.value}" nicht gefunden`,
|
||||||
|
color: 'red-6',
|
||||||
|
icon: 'cancel',
|
||||||
|
position: 'top'
|
||||||
|
})
|
||||||
|
}).finally(() =>
|
||||||
|
isLoading.value = false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=0
|
MAJOR=0
|
||||||
MINOR=8
|
MINOR=9
|
||||||
PATCH=0
|
PATCH=0
|
||||||
|
|||||||
Reference in New Issue
Block a user