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