From 8e519d0a3426c1c4999f6b8c1112f9e122843e38 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 9 Oct 2019 17:47:03 +0200 Subject: [PATCH] Add server player to initial player list --- src/store/network/mutations.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/store/network/mutations.ts b/src/store/network/mutations.ts index 56103e3..6feaaa5 100644 --- a/src/store/network/mutations.ts +++ b/src/store/network/mutations.ts @@ -1,15 +1,12 @@ +import { ChatMessage, LocalClient, PeerClient, PeerServer } from "@/network"; import { MutationTree } from "vuex"; -import { - NetworkState, - ServerNetworkState, - ClientNetworkState, - ConnectionStatus -} from "./types"; -import { LocalClient, PeerServer, PeerClient, ChatMessage } from "@/network"; + +import { ClientNetworkState, ConnectionStatus, NetworkState, ServerNetworkState } from "./types"; const mutations: MutationTree = { becomeServer(state, payload: { local: LocalClient; server: PeerServer }) { state.peerType = "server"; + state.players = [payload.local.name]; (state as ServerNetworkState).local = payload.local; (state as ServerNetworkState).server = payload.server; },