Updated Profile
Updated code to filter out subscriptions that have been removed from the profile, and insert new ones into the list in the Update() fucntion.
This commit is contained in:
parent
561ba4f34a
commit
b08c22e77b
1 changed files with 14 additions and 1 deletions
|
|
@ -18,6 +18,19 @@ public class Profile
|
|||
if (other.name != name) name = other.name;
|
||||
if (other.bgColor != bgColor) bgColor = other.bgColor;
|
||||
if (other.textColor != textColor) textColor = other.textColor;
|
||||
if (other.subscriptions.Count != subscriptions.Count) subscriptions = other.subscriptions;
|
||||
var remove = new List<Subscription>();
|
||||
foreach (var sub in subscriptions)
|
||||
{
|
||||
if (other.subscriptions.Any(x => x.id == sub.id)) continue;
|
||||
remove.Add(sub);
|
||||
}
|
||||
subscriptions.RemoveAll(x => remove.Contains(x));
|
||||
remove.Clear();
|
||||
foreach (var sub in other.subscriptions)
|
||||
{
|
||||
if (subscriptions.Any(x => x.id == sub.id)) continue;
|
||||
remove.Add(sub);
|
||||
}
|
||||
subscriptions.AddRange(remove);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue