Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Small improvements to kive kudos through swipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Depechie committed Dec 13, 2016
1 parent 5726699 commit fafec26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Kliva/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using Kliva.Views;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using GalaSoft.MvvmLight.Messaging;
using Kliva.Extensions;
using Kliva.Services;
using Microsoft.Practices.ServiceLocation;

namespace Kliva.ViewModels
{
Expand Down Expand Up @@ -187,11 +189,16 @@ private async Task OnKudosAsync(ActivitySummary activitySummary)
var canGiveKudos = _athlete.Id != activitySummary.Athlete.Id && !activitySummary.HasKudoed;
if (canGiveKudos)
{
IsBusy = true;
await _stravaService.GiveKudosAsync(activitySummary.Id.ToString());
activitySummary.HasKudoed = true;
++activitySummary.KudosCount;
ActivityInvoked(activitySummary);
IsBusy = false;
}

//TODO: Glenn - when we are triggering a kudos, open kudos tab in detail page
ActivityInvoked(activitySummary);
ServiceLocator.Current.GetInstance<IMessenger>().Send<PivotMessage<ActivityPivots>>(new PivotMessage<ActivityPivots>(ActivityPivots.Kudos, true, true), Tokens.ActivityPivotMessage);
}

private void OnComment(ActivitySummary activitySummary)
Expand Down

0 comments on commit fafec26

Please sign in to comment.