/**
 * Listeners for header
 */

import $ from 'jquery'
import { version } from '../../../package.json'
import { reload, erase } from '../game-util'

const deleteFriendo = (friendo) => {
  console.log('called')
  if (!friendo) {
    alert('No Friendo DNA found!')
  } else if ($('#delete-check1').prop('checked') && $('#delete-check2').prop('checked')) {

    // handle deletion flavor text
    if (friendo.level >= 1) {
      alert(`"... ${friendo.owner}... goodbye..."`)
    } else {
      alert('You hear a cracking noise as the egg fades into nothingness.')
    }

    // delete friendo and refresh
    erase()
    reload()
  }
}

export default () => {
  $('#vernum').html(`[ v${version} ]`).attr('href', `https://github.com/mattdelsordo/friendo/releases/tag/v${version}`)

  $('#game-info-icon').mouseenter(() => {
    $('#game-info').css('visibility', 'visible')
  })

  $('#header').mouseleave(() => {
    $('#game-info').css('visibility', 'hidden')
  })

  $('#delete-btn').click(() => {
    deleteFriendo()
  })
}

export const updateDelete = (friendo) => {
  $('#delete-btn').off('click').click(() => {
    deleteFriendo(friendo)
  })
}

@@ -143,16 +143,46 @@
 -util'%0A%0A
+/* eslint-disable no-alert */%0A
 const de
@@ -214,32 +214,8 @@
 %3E %7B%0A
-  console.log('called')%0A
   if
@@ -354,17 +354,16 @@
 ed')) %7B%0A
-%0A
     // h
@@ -631,16 +631,45 @@
 ()%0A  %7D%0A%7D
+%0A/* eslint-enable no-alert */
 %0A%0Aexport

Fix unnoticed deletion widget eslint errors