aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/main.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2016-09-14 15:27:50 +0200
committerNoah Loomans <noahloomans@gmail.com>2016-09-14 15:27:50 +0200
commitfbb721b5fc25ec5e46bef4055eb95ac0e837b476 (patch)
tree827a2dc5e66813da5f867e875096944a49512f68 /public/javascripts/main.js
parentc8c8af7a3aa5200cd1e7ffaf4c9833ddc4a4b783 (diff)
name hotfix
Diffstat (limited to 'public/javascripts/main.js')
-rw-r--r--public/javascripts/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/public/javascripts/main.js b/public/javascripts/main.js
index aecf21f..b20ce6b 100644
--- a/public/javascripts/main.js
+++ b/public/javascripts/main.js
@@ -44,8 +44,8 @@ const users = getUsers()
function getCurrentFav () {
if (!window.localStorage.getItem('fav')) return
const favCode = window.localStorage.getItem('fav').split(':')
- const fav = users.filter(user => user.type === favCode[0] && user.index === Number(favCode[1]))[0]
- return fav
+ const fav = users.filter(user => user.type === favCode[0] && user.index === Number(favCode[1]))
+ return fav[fav.length - 1]
}
function changeFav (isFav) {
@@ -114,7 +114,7 @@ searchNode.addEventListener('submit', submitForm)
function submitForm (e) {
if (e) e.preventDefault()
- if (results != null) {
+ if (results !== null) {
const indexInResult = selectedResult === -1 ? 0 : selectedResult
selectedUser = users[results[indexInResult].index]
}