import "phoenix_html"
import $ from "jquery";
import * as BS from "./battle_snake"

const BattleSnake = Object.assign(window.BattleSnake, BS);
window.BattleSnake = BattleSnake;

if ($("#board-viewer")) {
  const gameId = window.BattleSnake.gameId;
  window.BattleSnake.BoardViewer.init(gameId);
}

import "phoenix_html"
import $ from "jquery";
import * as BS from "./battle_snake"

const BattleSnake = Object.assign(window.BattleSnake, BS);
window.BattleSnake = BattleSnake;

if ($("#board-viewer").length) {
  const gameId = window.BattleSnake.gameId;
  window.BattleSnake.BoardViewer.init(gameId);
}

Fix issue with js conditional
Fix issue with js conditional

Was not properly testing if there was any results, causing the js to be
evaluated on  every page.
