Skip to content

Commit 42bb954

Browse files
Fix hearts for scoreboard on local filesystem
Fixes #2724
1 parent ef55f05 commit 42bb954

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

webapp/public/js/domjudge.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function getCookie(name)
200200

201201
function getSelectedTeams()
202202
{
203-
var cookieVal = getCookie("domjudge_teamselection");
203+
var cookieVal = localStorage.getItem("domjudge_teamselection");
204204
if (cookieVal === null || cookieVal === "") {
205205
return new Array();
206206
}
@@ -284,10 +284,15 @@ function toggle(id, show)
284284
}
285285

286286
var cookieVal = JSON.stringify(favTeams);
287-
setCookie("domjudge_teamselection", cookieVal);
287+
localStorage.setItem("domjudge_teamselection", cookieVal);
288288

289289

290290
$('.loading-indicator').addClass('ajax-loader');
291+
// If we are on a local file system, reload the window
292+
if (window.location.protocol === 'file:') {
293+
window.location.reload();
294+
return;
295+
}
291296
$.ajax({
292297
url: scoreboardUrl,
293298
cache: false

0 commit comments

Comments
 (0)