Permalink
Browse files

Fix TypeError on metrics-enabled: false & Automatically focus the “pl…

…ayer name” input field when loading the pa
  • Loading branch information...
1 parent 22ed07e commit 397ae7e1ac630b606f98041be36c51ae380bac4a @Ambilight committed Apr 2, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 client/index.html
  2. +1 −1 server/js/main.js
View
@@ -75,7 +75,7 @@ <h1>
<div></div>
</div>
<form action="none" method="get" accept-charset="utf-8">
- <input type="text" id="nameinput" class="stroke" name="player-name" placeholder="Name your character" maxlength="15">
+ <input type="text" id="nameinput" class="stroke" name="player-name" placeholder="Name your character" maxlength="15" autofocus>
</form>
<div class="play button disabled">
<div></div>
View
@@ -13,7 +13,7 @@ function main(config) {
worlds = [],
lastTotalPlayers = 0,
checkPopulationInterval = setInterval(function() {
- if(metrics.isReady) {
+ if(metrics && metrics.isReady) {
metrics.getTotalPlayers(function(totalPlayers) {
if(totalPlayers !== lastTotalPlayers) {
lastTotalPlayers = totalPlayers;

0 comments on commit 397ae7e

Please sign in to comment.