Skip to content

Commit

Permalink
Store full model rather than online ID only
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Nov 8, 2021
1 parent 72489b3 commit 7460325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Game/Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Bindable<BeatmapSetFavouriteState> Current
set => current.Current = value;
}

private readonly int onlineBeatmapID;
private readonly APIBeatmapSet beatmapSet;

private PostBeatmapFavouriteRequest favouriteRequest;

Expand All @@ -33,7 +33,7 @@ public Bindable<BeatmapSetFavouriteState> Current
public FavouriteButton(APIBeatmapSet beatmapSet)
{
current = new BindableWithCurrent<BeatmapSetFavouriteState>(new BeatmapSetFavouriteState(beatmapSet.HasFavourited, beatmapSet.FavouriteCount));
onlineBeatmapID = beatmapSet.OnlineID;
this.beatmapSet = beatmapSet;
}

protected override void LoadComplete()
Expand All @@ -49,7 +49,7 @@ private void toggleFavouriteStatus()
var actionType = current.Value.Favourited ? BeatmapFavouriteAction.UnFavourite : BeatmapFavouriteAction.Favourite;

favouriteRequest?.Cancel();
favouriteRequest = new PostBeatmapFavouriteRequest(onlineBeatmapID, actionType);
favouriteRequest = new PostBeatmapFavouriteRequest(beatmapSet.OnlineID, actionType);

Enabled.Value = false;
favouriteRequest.Success += () =>
Expand Down

0 comments on commit 7460325

Please sign in to comment.