diff --git a/web/app/assets/javascripts/JamServer.js b/web/app/assets/javascripts/JamServer.js index 093afe2b2..06d5a7bc2 100644 --- a/web/app/assets/javascripts/JamServer.js +++ b/web/app/assets/javascripts/JamServer.js @@ -377,12 +377,12 @@ try { const url = new URL(loggedInResp); const redirectTo = new URLSearchParams(url.search).get("redirect-to"); - console.log("_DEBUG_ handleLoggedInResponse redirecting to", loggedInResp); + console.log("** handleLoggedInResponse redirecting to", loggedInResp); if (redirectTo) { window.location.href = redirectTo; } } catch (e) { - console.log("error in handleLoggedInResponse", e); + console.log("** error in handleLoggedInResponse", e); } } diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index 5dd71b747..a58e17e05 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -459,27 +459,28 @@ // this is a hack to create a session from a custom URL scheme // an example custom URL would be: https://www.jamkazam.com/client#/createSession/custom~yes|privacy~2|description~hello|inviteeIds~1,2,3,4 - var hash = decodeURIComponent(window.location.hash) - - console.log("** handleCustomUrlScheme hash **", hash); - - if(hash === '' || !hash.includes("custom~yes")){ // if there is no hash or the hash does not contain custom~yes, - return; - } - var maxAttempts = 10; var screenLoadInterval = setInterval(() => { - if(hash.includes("#/createSession")){ - if (JK.createScheduledSessionScreen) { - JK.createScheduledSessionScreen.createSessionByCustomUrlScheme(hash); // this will create a session - clearInterval(screenLoadInterval); - }else{ - console.log("** attempting to create session by custom URL scheme", maxAttempts); - maxAttempts--; - if(maxAttempts <= 0){ + + var hash = decodeURIComponent(window.location.hash) + + console.log("** handleCustomUrlScheme hash **", hash); + + if(hash.includes("custom~yes")){ // if the hash contains the custom yes flag + + if(hash.includes("#/createSession")){ // if the hash contains the createSession flag + + if (JK.createScheduledSessionScreen) { + JK.createScheduledSessionScreen.createSessionByCustomUrlScheme(hash); // this will create a session clearInterval(screenLoadInterval); - } + }else{ + console.log("** attempting to create session by custom URL scheme", maxAttempts); + maxAttempts--; + if(maxAttempts <= 0){ + clearInterval(screenLoadInterval); + } + } } } }, 1000); // check every second