diff --git a/src/renderer/components/panels/ServerPanel.scss b/src/renderer/components/panels/ServerPanel.scss index 5a91401..63e2340 100644 --- a/src/renderer/components/panels/ServerPanel.scss +++ b/src/renderer/components/panels/ServerPanel.scss @@ -48,7 +48,6 @@ align-items: flex-start; align-content: flex-start; padding: 6px; - min-width: 300px; max-height: 340px; overflow: hidden; } diff --git a/src/renderer/components/panels/ServerPanel.tsx b/src/renderer/components/panels/ServerPanel.tsx index b3da7d9..f7d1e72 100644 --- a/src/renderer/components/panels/ServerPanel.tsx +++ b/src/renderer/components/panels/ServerPanel.tsx @@ -335,6 +335,7 @@ class Panel extends React.PureComponent { } private renderPlayers (players: (Player | null)[]): JSX.Element[] { + const { isConnected } = this.props return players .filter(player => !!player) .map( @@ -344,12 +345,17 @@ class Panel extends React.PureComponent { key={index} className='server-panel-player' > -
- -
-
- { course.short } -
+ { + isConnected && + <> +
+ +
+
+ { course.short } +
+ + }
@@ -464,7 +470,7 @@ class Panel extends React.PureComponent { /> } -
+
{ this.renderPlayers(players) } diff --git a/src/renderer/reducers/connection.ts b/src/renderer/reducers/connection.ts index 85953ea..649ecd2 100644 --- a/src/renderer/reducers/connection.ts +++ b/src/renderer/reducers/connection.ts @@ -36,12 +36,12 @@ export const connection = (state: ConnectionState = initialState.connection, act case ConnectionActionType.UPDATE_PLAYER_POSITIONS: draft.selfPos = action.self draft.cameraAngle = action.cameraAngle + if (!draft.server) return + if (!draft.server.players) return for (let i = 0; i < action.positions.length; i++) { const position = action.positions[i] if (!position) continue - if (!draft.server) return - if (!draft.server.players) return - if (!draft.server.players[i + 1]) return + if (!draft.server.players[i + 1]) continue const prevCourse = draft.server.players[i + 1]!.position != null ? draft.server.players[i + 1]!.position!.course : 0 draft.server.players[i + 1]!.position = position if (draft.server.players[i + 1]!.position!.course === 0) {