mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-22 10:55:15 -04:00
Cleanup
This commit is contained in:
parent
e29f08264c
commit
aea96d5eba
3 changed files with 13 additions and 16 deletions
|
@ -136,8 +136,7 @@ public class DashboardViewModel : PropertyChangedBase
|
|||
!IsBusy &&
|
||||
_discord is not null &&
|
||||
SelectedGuild is not null &&
|
||||
SelectedChannels is not null &&
|
||||
SelectedChannels.Any();
|
||||
SelectedChannels?.Any() is true;
|
||||
|
||||
public async void ExportChannels()
|
||||
{
|
||||
|
|
|
@ -21,12 +21,11 @@ public class ExportSetupViewModel : DialogScreen
|
|||
|
||||
public IReadOnlyList<Channel>? Channels { get; set; }
|
||||
|
||||
public bool IsSingleChannel => Channels is null || Channels.Count == 1;
|
||||
public bool IsSingleChannel => Channels?.Count == 1;
|
||||
|
||||
public string? OutputPath { get; set; }
|
||||
|
||||
public IReadOnlyList<ExportFormat> AvailableFormats =>
|
||||
Enum.GetValues(typeof(ExportFormat)).Cast<ExportFormat>().ToArray();
|
||||
public IReadOnlyList<ExportFormat> AvailableFormats { get; } = Enum.GetValues<ExportFormat>();
|
||||
|
||||
public ExportFormat SelectedFormat { get; set; }
|
||||
|
||||
|
@ -96,12 +95,11 @@ public class ExportSetupViewModel : DialogScreen
|
|||
_settingsService.LastShouldDownloadMedia = ShouldDownloadMedia;
|
||||
|
||||
// If single channel - prompt file path
|
||||
if (Channels is not null && IsSingleChannel)
|
||||
if (IsSingleChannel)
|
||||
{
|
||||
var channel = Channels.Single();
|
||||
var defaultFileName = ExportRequest.GetDefaultOutputFileName(
|
||||
Guild!,
|
||||
channel,
|
||||
Channels!.Single(),
|
||||
SelectedFormat,
|
||||
After?.Pipe(Snowflake.FromDate),
|
||||
Before?.Pipe(Snowflake.FromDate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue