Skip to content

Commit

Permalink
Update MainCard.razor
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Nov 10, 2022
1 parent d6dcf2e commit 2920b54
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions GamePortal/Shared/Partial/Main/MainCard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,29 @@
}
}

private async void Set(string Address, string Title, int Value)
private async void Set(string Address, string Title, int Star)
{
await Local.Set($"{Address}-rating", $"{Value}");

AppCenterService.TrackEvent($"Game-{Title}", "Rating", $"{Value} Star");
string Key = $"{Address}-rating";
string Value = $"{Star}";

bool End = true;
bool State = await Local.Check(Key);

if (State)
{
string Result = await Local.Get(Key);

if (Result == Value)
{
End = false;
}
}

if (End)
{
await Local.Set(Key, Value);

AppCenterService.TrackEvent($"Game-{Title}", "Rating", $"{Star} Star");
}
}
}

0 comments on commit 2920b54

Please sign in to comment.