#221: Fixed
This commit is contained in:
@@ -27,7 +27,6 @@ namespace FoxTube.Pages.SettingsPages
|
||||
/// </summary>
|
||||
public sealed partial class Inbox : Page
|
||||
{
|
||||
List<InboxItem> backup = new List<InboxItem>();
|
||||
List<InboxItem> items = new List<InboxItem>();
|
||||
public Inbox()
|
||||
{
|
||||
@@ -57,43 +56,34 @@ namespace FoxTube.Pages.SettingsPages
|
||||
));
|
||||
|
||||
items.OrderBy(item => item.TimeStamp);
|
||||
|
||||
foreach (InboxItem i in items)
|
||||
backup.Add(i);
|
||||
}
|
||||
catch { }
|
||||
|
||||
list.ItemsSource = items;
|
||||
items.ForEach(i => list.Items.Add(i));
|
||||
}
|
||||
|
||||
private void filter_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
items.Clear();
|
||||
list.ItemsSource = null;
|
||||
list.Items.Clear();
|
||||
|
||||
switch (filter.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
foreach (InboxItem i in backup)
|
||||
items.Add(i);
|
||||
items.ForEach(i => list.Items.Add(i));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
foreach (InboxItem i in backup)
|
||||
if(i.Type == InboxItemType.Default)
|
||||
items.Add(i);
|
||||
List<InboxItem> messages = items.FindAll(i => i.Type == InboxItemType.Default);
|
||||
messages.ForEach(i => list.Items.Add(i));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
foreach (InboxItem i in backup)
|
||||
if (i.Type == InboxItemType.PatchNote)
|
||||
items.Add(i);
|
||||
List<InboxItem> notes = items.FindAll(i => i.Type == InboxItemType.PatchNote);
|
||||
notes.ForEach(i => list.Items.Add(i));
|
||||
break;
|
||||
}
|
||||
|
||||
list.ItemsSource = items;
|
||||
}
|
||||
catch(NullReferenceException) { }
|
||||
}
|
||||
@@ -144,7 +134,7 @@ namespace FoxTube.Pages.SettingsPages
|
||||
string id = arg.Split('&')[1];
|
||||
InboxItem item = items.Find(x => x.Id == id);
|
||||
if(item != null)
|
||||
list.SelectedIndex = items.IndexOf(item);
|
||||
list.SelectedItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user