aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcglatot <[email protected]>2020-10-29 09:29:41 +0000
committercglatot <[email protected]>2020-10-29 09:29:41 +0000
commitd98fb1409fdd2373b899a1370af477550490bd45 (patch)
tree5f651c75ac633235db7613f2cb3b4476bc3226f0
parent4485f808baa3827842a3c6326edc0cc916793e12 (diff)
downloadpasta-d98fb1409fdd2373b899a1370af477550490bd45.tar.gz
pasta-d98fb1409fdd2373b899a1370af477550490bd45.zip
Fix for Apple + Safari
-rw-r--r--js/main.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/main.js b/js/main.js
index c0b7d11..cb23a7f 100644
--- a/js/main.js
+++ b/js/main.js
@@ -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');
}