mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-05-24 17:52:24 +00:00
Refactor
This commit is contained in:
@@ -53,7 +53,7 @@ public partial class DashboardViewModel : ViewModelBase
|
||||
private Guild? _selectedGuild;
|
||||
|
||||
[ObservableProperty]
|
||||
private IReadOnlyList<ChannelNode>? _availableChannels;
|
||||
private IReadOnlyList<ChannelConnection>? _availableChannels;
|
||||
|
||||
public DashboardViewModel(
|
||||
ViewModelManager viewModelManager,
|
||||
@@ -88,7 +88,7 @@ public partial class DashboardViewModel : ViewModelBase
|
||||
|
||||
public bool IsProgressIndeterminate => IsBusy && Progress.Current.Fraction is <= 0 or >= 1;
|
||||
|
||||
public ObservableCollection<ChannelNode> SelectedChannels { get; } = [];
|
||||
public ObservableCollection<ChannelConnection> SelectedChannels { get; } = [];
|
||||
|
||||
[RelayCommand]
|
||||
private void Initialize()
|
||||
@@ -190,7 +190,7 @@ public partial class DashboardViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
// Build a hierarchy of channels
|
||||
var channelTree = ChannelNode.BuildTree(
|
||||
var channelTree = ChannelConnection.BuildTree(
|
||||
channels
|
||||
.OrderByDescending(c => c.IsDirect ? c.LastMessageId : null)
|
||||
.ThenBy(c => c.Position)
|
||||
|
||||
@@ -28,7 +28,9 @@ public partial class DashboardView : UserControl<DashboardViewModel>
|
||||
)
|
||||
{
|
||||
// Hack: unselect categories because they cannot be exported
|
||||
foreach (var item in args.AddedItems.OfType<ChannelNode>().Where(x => x.Channel.IsCategory))
|
||||
foreach (
|
||||
var item in args.AddedItems.OfType<ChannelConnection>().Where(x => x.Channel.IsCategory)
|
||||
)
|
||||
{
|
||||
if (AvailableChannelsTreeView.TreeContainerFromItem(item) is TreeViewItem container)
|
||||
container.IsSelected = false;
|
||||
|
||||
Reference in New Issue
Block a user