improved if/else logics
This commit is contained in:
parent
a4f332deba
commit
d22a7b769b
@ -17,12 +17,16 @@ const screen:Ref<string> = ref('login');
|
|||||||
const socket = useSocketStore();
|
const socket = useSocketStore();
|
||||||
|
|
||||||
socket.$subscribe((mutation, state) => {
|
socket.$subscribe((mutation, state) => {
|
||||||
if (state.isAuthenticated) {
|
if (!state.isAuthenticated) {
|
||||||
screen.value = 'character_selection';
|
screen.value = 'login';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state.isAuthenticated){
|
||||||
|
screen.value = 'characters';
|
||||||
|
|
||||||
if (state.character) {
|
if (state.character) {
|
||||||
screen.value = 'game';
|
screen.value = 'game';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, { detached: true })
|
}, { detached: true })
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user