Skip to content

Commit

Permalink
Removed “You” and fixed realtime chip bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Murali Suresh committed Jan 26, 2017
1 parent 6347b4f commit 94eccdd
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions reactJS/app/components/EventPageComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,18 @@ class EventPageComponent extends Component {

switch(attendee.personalizedDateSelection[key])
{
case "free": free_count++; freelist.push(attendee.attendeeName); break;
case "maybe": maybe_count++; maybelist.push(attendee.attendeeName); break;
case "busy": busy_count++; busylist.push(attendee.attendeeName); break;
case "free":
free_count++;
(cookie_available && this.getCookieAttendeeDetails().attendeeName == attendee.attendeeName)?freelist.push(this.props.attendeeName):freelist.push(attendee.attendeeName);
break;
case "maybe":
maybe_count++;
(cookie_available && this.getCookieAttendeeDetails().attendeeName == attendee.attendeeName)?maybelist.push(this.props.attendeeName):maybelist.push(attendee.attendeeName);
break;
case "busy":
busy_count++;
(cookie_available && this.getCookieAttendeeDetails().attendeeName == attendee.attendeeName)?busylist.push(this.props.attendeeName):busylist.push(attendee.attendeeName);
break;
}

}
Expand All @@ -711,17 +720,17 @@ class EventPageComponent extends Component {
defaultBusy_check=0; // Check if User changed status from default busy
switch(this.props.personalizedDateSelection[key])
{
case "free": free_count++; freelist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "maybe": maybe_count++; maybelist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "busy": busy_count++; busylist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "free": free_count++; freelist.push(this.props.attendeeName); break;
case "maybe": maybe_count++; maybelist.push(this.props.attendeeName); break;
case "busy": busy_count++; busylist.push(this.props.attendeeName); break;
}
}
}

//Increase busy count +1 if date is checked busy (default)
if(defaultBusy_check==1) {
busy_count++;
busylist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName);
busylist.push(this.props.attendeeName);
}

}
Expand All @@ -737,20 +746,20 @@ class EventPageComponent extends Component {
for(let key in this.props.personalizedDateSelection){
if(date==key && this.props.personalizedDateSelection[key]!=status) // If user is changing his mind , then update graph
{
// Increment his new decision
// Increment his/her new decision
switch(this.props.personalizedDateSelection[key])
{
case "free": free_count++; freelist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "maybe": maybe_count++; maybelist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "busy": busy_count++; busylist.push(this.props.attendeeName.length==0?"You":this.props.attendeeName); break;
case "free": free_count++; freelist.push(this.props.attendeeName); break;
case "maybe": maybe_count++; maybelist.push(this.props.attendeeName); break;
case "busy": busy_count++; busylist.push(this.props.attendeeName); break;
}

// Decrement his old decision
// Decrement his/her old decision
switch(status)
{
case "free": free_count--; freelist=freelist.filter(e => e !== attendeeDetails.attendeeName); break;
case "maybe": maybe_count--; maybelist=maybelist.filter(e => e !== attendeeDetails.attendeeName); break;
case "busy": busy_count--; busylist=busylist.filter(e => e !== attendeeDetails.attendeeName); break;
case "free": free_count--; freelist=freelist.filter(e => e !== this.props.attendeeName); break;
case "maybe": maybe_count--; maybelist=maybelist.filter(e => e !== this.props.attendeeName); break;
case "busy": busy_count--; busylist=busylist.filter(e => e !== this.props.attendeeName); break;
}

}
Expand Down

0 comments on commit 94eccdd

Please sign in to comment.