diff options
author | cglatot <[email protected]> | 2020-10-29 09:29:41 +0000 |
---|---|---|
committer | cglatot <[email protected]> | 2020-10-29 09:29:41 +0000 |
commit | d98fb1409fdd2373b899a1370af477550490bd45 (patch) | |
tree | 5f651c75ac633235db7613f2cb3b4476bc3226f0 /js | |
parent | 4485f808baa3827842a3c6326edc0cc916793e12 (diff) | |
download | pasta-d98fb1409fdd2373b899a1370af477550490bd45.tar.gz pasta-d98fb1409fdd2373b899a1370af477550490bd45.zip |
Fix for Apple + Safari
Diffstat (limited to 'js')
-rw-r--r-- | js/main.js | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -21,7 +21,15 @@ var libraryType = "shows"; // Sets whether the library is a show or a movie / ot $(document).ready(() => { // Check if there is a page refresh, if so we want to push the history without the # - let navigationType = performance.getEntriesByType("navigation")[0].type; + let navigationType; + if (window.performance && window.performance.getEntriesByType('navigation').length) { + navigationType = window.performance.getEntriesByType("navigation")[0].type; + } else if (performance.getEntriesByType('navigation').length) { + navigationType = performance.getEntriesByType("navigation")[0].type; + } + else { + console.log("Couldn't find the window.performance or performance to get reload information"); + } if ((navigationType == 'reload') && (window.location.href.indexOf('#authentication') == -1)) { window.history.pushState('', document.title, window.location.pathname + '#authentication'); } |