1
0
forked from noxious/client

improved if/else logics

This commit is contained in:
Dennis Postma 2024-05-16 00:32:29 +02:00
parent a4f332deba
commit d22a7b769b

View File

@ -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.character) { if (state.isAuthenticated){
screen.value = 'game'; screen.value = 'characters';
if (state.character) {
screen.value = 'game';
}
} }
}, { detached: true }) }, { detached: true })
</script> </script>