From: Radek Czajka Date: Thu, 2 Jul 2020 15:43:02 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/0f63b71840c171609f7a267ca054a5d2a39a7f3f?hp=623676b97cc93293eff63398c7deb45cdec76af9 fix --- diff --git a/src/catalogue/static/player/player.js b/src/catalogue/static/player/player.js index d80446318..d93bbad1c 100644 --- a/src/catalogue/static/player/player.js +++ b/src/catalogue/static/player/player.js @@ -46,7 +46,11 @@ var initialElem = $('.play', $root).first(); var initialTime = 0; if (Modernizr.localstorage) { - audiobooks = JSON.parse(localStorage["audiobook-history"]); + try { + audiobooks = JSON.parse(localStorage["audiobook-history"]); + } catch { + audiobooks = {}; + } last = audiobooks[$root.attr("data-book-id")] if (last) { initialElem = $('[data-media-id="' + last[1] + '"] .play', $root).first();