mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-23 06:24:48 +00:00
Remove Channel.ParentNameWithFallback
This commit is contained in:
@@ -13,10 +13,10 @@ public class ChannelToGroupKeyConverter : IValueConverter
|
||||
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
||||
value switch
|
||||
{
|
||||
Channel channel when channel.Kind.IsThread()
|
||||
=> $"Threads in #{channel.ParentNameWithFallback}",
|
||||
Channel { IsThread: true, Parent: not null } channel
|
||||
=> $"Threads in #{channel.Parent.Name}",
|
||||
|
||||
Channel channel => channel.ParentNameWithFallback,
|
||||
Channel channel => channel.Parent?.Name ?? "???",
|
||||
|
||||
_ => null
|
||||
};
|
||||
|
||||
@@ -43,8 +43,6 @@ public class DashboardViewModel : PropertyChangedBase
|
||||
|
||||
public Guild? SelectedGuild { get; set; }
|
||||
|
||||
public bool IsDirectMessageGuildSelected => SelectedGuild?.Id == Guild.DirectMessages.Id;
|
||||
|
||||
public IReadOnlyList<Channel>? AvailableChannels { get; private set; }
|
||||
|
||||
public IReadOnlyList<Channel>? SelectedChannels { get; set; }
|
||||
@@ -164,7 +162,7 @@ public class DashboardViewModel : PropertyChangedBase
|
||||
// Regular channels
|
||||
await foreach (var channel in _discord.GetGuildChannelsAsync(SelectedGuild.Id))
|
||||
{
|
||||
if (channel.Kind == ChannelKind.GuildCategory)
|
||||
if (channel.IsCategory)
|
||||
continue;
|
||||
|
||||
channels.Add(channel);
|
||||
|
||||
@@ -313,10 +313,10 @@
|
||||
<ListBox.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type ListBox}}" TargetType="{x:Type ListBox}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsDirectMessageGuildSelected}" Value="True">
|
||||
<DataTrigger Binding="{Binding SelectedGuild.IsDirect}" Value="True">
|
||||
<Setter Property="ItemsSource" Value="{Binding Source={StaticResource AvailableDirectChannelsViewSource}}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsDirectMessageGuildSelected}" Value="False">
|
||||
<DataTrigger Binding="{Binding SelectedGuild.IsDirect}" Value="False">
|
||||
<Setter Property="ItemsSource" Value="{Binding Source={StaticResource AvailableChannelsViewSource}}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
|
||||
@@ -60,8 +60,10 @@
|
||||
FontWeight="Light"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||
<Run Text="{Binding Channels[0].ParentNameWithFallback, Mode=OneWay}" ToolTip="{Binding Channels[0].ParentNameWithFallback, Mode=OneWay}" />
|
||||
<Run Text="/" />
|
||||
<TextBlock Visibility="{Binding Channels[0].Parent, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||
<Run Text="{Binding Channels[0].Parent.Name, Mode=OneWay}" ToolTip="{Binding Channels[0].Parent.Name, Mode=OneWay}" />
|
||||
<Run Text="/" />
|
||||
</TextBlock>
|
||||
<Run
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding Channels[0].Name, Mode=OneWay}"
|
||||
|
||||
Reference in New Issue
Block a user