Skip to content

Commit

Permalink
Fixed Bug Introduced During One-Person Events
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo authored Oct 3, 2016
1 parent 5fb14fe commit 21d7c5e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,24 @@ function checkIfBusy(id) {

if (!verboseEvent.transparency) { // if the event is 'busy', not 'available'

for (var j in verboseEvent.attendees) { // go through the attendees of the event to find "self"
Logger.log(verboseEvent);

if (!verboseEvent.attendees) { // events with just one person don't have attendees, so

if (verboseEvent.attendees[j].self && verboseEvent.attendees[j].responseStatus != "declined") { // check the "self" attendee and see if it's declined the event. If I haven't...
busyEvents.push(verboseEvent); // add the event to our array

} else { // event with multiple people? we gotta check to make sure we haven't declined the event

for (var j in verboseEvent.attendees) { // go through the attendees of the event to find "self"

busyEvents.push(verboseEvent); // add the event to our array
if (verboseEvent.attendees[j].self && verboseEvent.attendees[j].responseStatus != "declined") { // check the "self" attendee and see if it's declined the event. If I haven't...

busyEvents.push(verboseEvent); // add the event to our array

}

}

}

}
Expand Down

0 comments on commit 21d7c5e

Please sign in to comment.