diff options
author | cglatot <[email protected]> | 2020-07-07 12:51:43 +0100 |
---|---|---|
committer | cglatot <[email protected]> | 2020-07-07 12:51:43 +0100 |
commit | d1ccf6836e660d89bf550253d73b8568e126cbbc (patch) | |
tree | 2d33ae7b8f30feff55fbfc60bf4fd6b9088927c6 | |
parent | 68a3a2f769683a733ad3e7129b8a78c54324d0ca (diff) | |
download | pasta-d1ccf6836e660d89bf550253d73b8568e126cbbc.tar.gz pasta-d1ccf6836e660d89bf550253d73b8568e126cbbc.zip |
Fix for mobile site
-rw-r--r-- | js/main.js | 34 |
1 files changed, 24 insertions, 10 deletions
@@ -41,16 +41,30 @@ $(document).ready(() => { } } // SET THE VARIABLES FOR PLEX PIN AUTH REQUESTS - let browserInfo = getBrowser(); - // Set the clientID, this might get overridden if one is saved to localstorage - clientIdentifier = `PASTA-cglatot-${Date.now()}-${Math.round(Math.random() * 1000)}`; - // Set the OS - deviceInfo = browserInfo.os; - // Set the web browser and version - pastaPlatform = browserInfo.browser; - pastaPlatformVersion = browserInfo.browserVersion; - // Set the main display name - deviceName = `PASTA (${pastaPlatform})`; + try { + let browserInfo = getBrowser(); + // Set the clientID, this might get overridden if one is saved to localstorage + clientIdentifier = `PASTA-cglatot-${Date.now()}-${Math.round(Math.random() * 1000)}`; + // Set the OS + deviceInfo = browserInfo.os || ""; + // Set the web browser and version + pastaPlatform = browserInfo.browser || ""; + pastaPlatformVersion = browserInfo.browserVersion || ""; + // Set the main display name + deviceName = `PASTA (${pastaPlatform})` || "PASTA"; + } catch (e) { + console.log(e); + // Fallback values + // Set the clientID, this might get overridden if one is saved to localstorage + clientIdentifier = `PASTA-cglatot-${Date.now()}-${Math.round(Math.random() * 1000)}`; + // Set the OS + deviceInfo = ""; + // Set the web browser and version + pastaPlatform = ""; + pastaPlatformVersion = ""; + // Set the main display name + deviceName = "PASTA"; + } // Validation listeners on the Plex URL Input $('#plexUrl').on("input", () => { |