Skip to content

Commit

Permalink
Clear board after signIn
Browse files Browse the repository at this point in the history
  • Loading branch information
CodaKhan committed May 5, 2017
1 parent ed0503a commit b58ed5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion assets/scripts/auth/events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const getFormFields = require(`../../../lib/get-form-fields`)

const api = require('./api')
const ui = require('./ui')

Expand Down
7 changes: 4 additions & 3 deletions assets/scripts/auth/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ const signInSuccess = (data) => {
$('.header-message').hide()
$('#signInModal').hide()
$('.authentication-stuff').show()
$('#gameboard').show()
$('#salutaion-message').html('Tic Tac Toe')
$('.nav-message').html(store.user.email + ' is Player "X"')
gameEvents.newGame()
$('#ChangePasswordSuccess').hide()
$('#change-password').trigger('reset')
$('#gameboard').show()
gameEvents.startGame()
gameEvents.newGame()
}

const signInFailure = (error) => {
Expand All @@ -57,6 +56,8 @@ const signOutSuccess = () => {
$('#signUpModal').hide()
$('#signInModal').show()
$('#signInModal').trigger('reset')
$('#sign-in').trigger('reset')
$('#sign-up').trigger('reset')
}

const signOutFailure = (error) => {
Expand Down
3 changes: 0 additions & 3 deletions assets/scripts/game/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ let oWinCount = 0

document.turn = 'X'
document.winner = null
let gameOver = null

const setMessage = function (msg) {
document.getElementById('message').innerText = msg
Expand Down Expand Up @@ -173,7 +172,6 @@ const tiedGame = function () {

const newGame = function () {
gameOver = null

$('#gameResultModal').hide()
$('#gameboard').show()
$('.nav-btns').show()
Expand All @@ -185,7 +183,6 @@ const newGame = function () {
const OnNewGame = function (event) {
event.preventDefault()
// const data = getFormFields(this)

startGame()
newGame()
}
Expand Down

0 comments on commit b58ed5f

Please sign in to comment.