diff --git a/web/app/assets/javascripts/scheduled_session.js.erb b/web/app/assets/javascripts/scheduled_session.js.erb index ae7f390eb..ebbd6a9b3 100644 --- a/web/app/assets/javascripts/scheduled_session.js.erb +++ b/web/app/assets/javascripts/scheduled_session.js.erb @@ -593,7 +593,7 @@ function startSessionClicked() { var $btn = $(this); if($btn.is('.disabled')) { return false; } - $btn.addClass('disabled') + $btn.addClass('disabled'); if(willOptionStartSession()) { @@ -722,8 +722,22 @@ }; if (createSessionSettings.createType == '<%= MusicSession::CREATE_TYPE_START_SCHEDULED%>') { - joinSession(createSessionSettings.selectedSessionId); - $('#create-session-buttons .btn-next').off('click'); + + // warn user if it's a TBD session + if (data.scheduled_start_date === "") { + sessionUtils.tbdScheduledSessionWarning( + function(evt) { + context.JK.app.layout.closeDialog('alert'); + joinSession(createSessionSettings.selectedSessionId); + $('#create-session-buttons .btn-next').off('click'); + }); + var $btnNext = $screen.find('.btn-next'); + $btnNext.removeClass('disabled'); + } + else { + joinSession(createSessionSettings.selectedSessionId); + $('#create-session-buttons .btn-next').off('click'); + } } else { rest.createScheduledSession(data) diff --git a/web/app/assets/javascripts/session_utils.js b/web/app/assets/javascripts/session_utils.js index 2fd34dd94..071f05567 100644 --- a/web/app/assets/javascripts/session_utils.js +++ b/web/app/assets/javascripts/session_utils.js @@ -188,7 +188,7 @@ "This session is over or is no longer public and cannot be joined. Please click Refresh to update the session list.", null, function(evt) { - context.JK.app.layout.closeDialog('alert'); + context.JK.app.layout.closeDialog('alert'); } ); @@ -196,6 +196,17 @@ context.JK.app.layout.showDialog('alert'); } + sessionUtils.tbdScheduledSessionWarning = function(callback) { + var alertDialog = new context.JK.AlertDialog(context.JK.app, "OK", + "If you start this session now, the scheduled start time will be set to the current date and time.", + null, + callback + ); + + alertDialog.initialize(); + context.JK.app.layout.showDialog('alert'); + } + function openJoinSessionTerms(sessionId) { var termsDialog = new context.JK.TermsDialog(context.JK.app, sessionId, onJoinSessionTermsAccepted); termsDialog.initialize();