Prevent duplicate profile pins

This commit is contained in:
sudokoko 2024-04-05 09:54:03 -04:00
parent 931f079265
commit 67d0d3d7b1
No known key found for this signature in database
GPG key ID: 248D68C664937395
2 changed files with 26 additions and 1 deletions

View file

@ -180,7 +180,7 @@ public class UserController : ControllerBase
// Sometimes the update gets called periodically as pin progress updates via playing,
// may not affect equipped profile pins however, so check before setting it.
string currentPins = user.Pins;
string newPins = string.Join(",", pinJson.ProfilePins);
string newPins = string.Join(",", pinJson.ProfilePins.Distinct());
if (string.Equals(currentPins, newPins)) return this.Ok("[{\"StatusCode\":200}]");