Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
#3 assign occupied seats correctly, fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
steffchep committed Feb 16, 2018
1 parent edb1be6 commit 59b8acb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/webapp/js/store/talks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ define(['store', 'computed', 'request', 'popups', 'dataHelper', 'scrollHelper'],
if (occupied === 0 || available === 0) {
return false;
}
console.log (occupied + "/" + available + "=" + (occupied / available));
console.log ("true or false? " + (occupied / available >= threshold));
return occupied / available >= threshold;
}

Expand Down Expand Up @@ -53,15 +51,16 @@ define(['store', 'computed', 'request', 'popups', 'dataHelper', 'scrollHelper'],
},
function(err) {
theTalk.fullyBooked = isFullyBooked(previousSeats, theTalk.availableSeats);
theTalk.availableSeats = previousSeats;
theTalk.occupiedSeats = previousSeats;
onError(err);
},
store.token
);
loadTalks();
},
function() {
theTalk.fullyBooked = !theTalk.fullyBooked;
theTalk.fullyBooked = isFullyBooked(previousSeats, theTalk.availableSeats);;
theTalk.occupiedSeats = previousSeats;
console.log("aborted");
}
);
Expand Down

0 comments on commit 59b8acb

Please sign in to comment.