parseInt prevEventId and nextEventID to be sure that our tests for != 0 work. Also don't go to previous event if prevEventId ==0.Maybe Fixes #3390

This commit is contained in:
Isaac Connor 2021-12-14 14:22:11 -05:00
parent 61fe35a32a
commit e8edeab641
1 changed files with 6 additions and 4 deletions

View File

@ -446,8 +446,10 @@ function streamFastRev(action) {
function streamPrev(action) { function streamPrev(action) {
if (action) { if (action) {
$j(".vjsMessage").remove(); $j(".vjsMessage").remove();
location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery); if (prevEventId != 0) {
return; location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery);
return;
}
/* Ideally I'd like to get back to this style /* Ideally I'd like to get back to this style
if ( vid && PrevEventDefVideoPath.indexOf("view_video") > 0 ) { if ( vid && PrevEventDefVideoPath.indexOf("view_video") > 0 ) {
@ -619,8 +621,8 @@ function getNearEventsResponse(respObj, respText) {
if (checkStreamForErrors('getNearEventsResponse', respObj)) { if (checkStreamForErrors('getNearEventsResponse', respObj)) {
return; return;
} }
prevEventId = respObj.nearevents.PrevEventId; prevEventId = parseInt(respObj.nearevents.PrevEventId);
nextEventId = respObj.nearevents.NextEventId; nextEventId = parseInt(respObj.nearevents.NextEventId);
prevEventStartTime = Date.parse(respObj.nearevents.PrevEventStartTime); prevEventStartTime = Date.parse(respObj.nearevents.PrevEventStartTime);
nextEventStartTime = Date.parse(respObj.nearevents.NextEventStartTime); nextEventStartTime = Date.parse(respObj.nearevents.NextEventStartTime);
PrevEventDefVideoPath = respObj.nearevents.PrevEventDefVideoPath; PrevEventDefVideoPath = respObj.nearevents.PrevEventDefVideoPath;