aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/dest/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/dest/main.js
parentc8c8af7a3aa5200cd1e7ffaf4c9833ddc4a4b783 (diff)
name hotfix
Diffstat (limited to 'public/javascripts/dest/main.js')
-rw-r--r--public/javascripts/dest/main.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/public/javascripts/dest/main.js b/public/javascripts/dest/main.js
index 5d77f01..6e31b87 100644
--- a/public/javascripts/dest/main.js
+++ b/public/javascripts/dest/main.js
@@ -1953,8 +1953,8 @@ function getCurrentFav() {
var favCode = window.localStorage.getItem('fav').split(':');
var fav = users.filter(function (user) {
return user.type === favCode[0] && user.index === Number(favCode[1]);
- })[0];
- return fav;
+ });
+ return fav[fav.length - 1];
}
function changeFav(isFav) {
@@ -2025,7 +2025,7 @@ searchNode.addEventListener('submit', submitForm);
function submitForm(e) {
if (e) e.preventDefault();
- if (results != null) {
+ if (results !== null) {
var indexInResult = selectedResult === -1 ? 0 : selectedResult;
selectedUser = users[results[indexInResult].index];
}
@@ -2118,7 +2118,7 @@ if (currentFav) {
scheduleIframe.src = getURLOfUser(offset, selectedUser.type, selectedUser.index + 1);
updateFavNode();
}
-}).call(this,require("rH1JPG"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_588f86c8.js","/")
+}).call(this,require("rH1JPG"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_de88aef.js","/")
},{"./getURLOfUser":9,"./getWeek":10,"buffer":2,"diacritics":3,"fuzzy":4,"rH1JPG":7}],9:[function(require,module,exports){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
var leftPad = require('left-pad')
@@ -2175,4 +2175,4 @@ module.exports = getWeek
}).call(this,require("rH1JPG"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/getWeek.js","/")
},{"buffer":2,"rH1JPG":7}]},{},[8])
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvbm9kZV9tb2R1bGVzL2Jyb3dzZXItcGFjay9fcHJlbHVkZS5qcyIsIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvbm9kZV9tb2R1bGVzL2Jhc2U2NC1qcy9saWIvYjY0LmpzIiwiL2hvbWUvY3lib3JnL0NvZGUvcm9vc3Rlci9ub2RlX21vZHVsZXMvYnVmZmVyL2luZGV4LmpzIiwiL2hvbWUvY3lib3JnL0NvZGUvcm9vc3Rlci9ub2RlX21vZHVsZXMvZGlhY3JpdGljcy9pbmRleC5qcyIsIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvbm9kZV9tb2R1bGVzL2Z1enp5L2xpYi9mdXp6eS5qcyIsIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvbm9kZV9tb2R1bGVzL2llZWU3NTQvaW5kZXguanMiLCIvaG9tZS9jeWJvcmcvQ29kZS9yb29zdGVyL25vZGVfbW9kdWxlcy9sZWZ0LXBhZC9pbmRleC5qcyIsIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvbm9kZV9tb2R1bGVzL3Byb2Nlc3MvYnJvd3Nlci5qcyIsIi9ob21lL2N5Ym9yZy9Db2RlL3Jvb3N0ZXIvcHVibGljL2phdmFzY3JpcHRzL2Zha2VfNTg4Zjg2YzguanMiLCIvaG9tZS9jeWJvcmcvQ29kZS9yb29zdGV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