diff --git a/src/components/sidebar/ServerList.vue b/src/components/sidebar/ServerList.vue index 1236e87..efdddf3 100644 --- a/src/components/sidebar/ServerList.vue +++ b/src/components/sidebar/ServerList.vue @@ -18,7 +18,7 @@ diff --git a/src/components/sidebar/ServerListItem.vue b/src/components/sidebar/ServerListItem.vue index d34944b..e467867 100644 --- a/src/components/sidebar/ServerListItem.vue +++ b/src/components/sidebar/ServerListItem.vue @@ -15,9 +15,10 @@ --> @@ -40,10 +41,23 @@ export default defineComponent({ computed: { currentServer(): LiveAtlasServerDefinition | undefined { return useStore().state.currentServer; + }, + selected(): boolean { + return this.currentServer && this.server.id === this.currentServer.id; } }, methods: { + handleKeydown(e: KeyboardEvent, serverId: string) { + if(e.key !== ' ' && e.key !== 'Enter') { + return; + } + + e.preventDefault(); + + this.setCurrentServer(serverId); + }, + setCurrentServer(serverId: string) { useStore().commit(MutationTypes.SET_CURRENT_SERVER, serverId); }