mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-23 06:24:48 +00:00
Refactor
This commit is contained in:
@@ -156,14 +156,11 @@ public class DashboardViewModel : PropertyChangedBase
|
||||
|
||||
var exporter = new ChannelExporter(_discord);
|
||||
|
||||
var channelProgressPairs = dialog
|
||||
.Channels!
|
||||
.Select(c => new
|
||||
{
|
||||
Channel = c,
|
||||
Progress = _progressMuxer.CreateInput()
|
||||
})
|
||||
.ToArray();
|
||||
var channelProgressPairs = dialog.Channels!.Select(c => new
|
||||
{
|
||||
Channel = c,
|
||||
Progress = _progressMuxer.CreateInput()
|
||||
}).ToArray();
|
||||
|
||||
var successfulExportCount = 0;
|
||||
|
||||
@@ -213,7 +210,7 @@ public class DashboardViewModel : PropertyChangedBase
|
||||
}
|
||||
);
|
||||
|
||||
// Notify of overall completion
|
||||
// Notify of the overall completion
|
||||
if (successfulExportCount > 0)
|
||||
{
|
||||
_eventAggregator.Publish(
|
||||
|
||||
@@ -25,7 +25,7 @@ public class DialogManager : IDisposable
|
||||
|
||||
void OnDialogOpened(object? openSender, DialogOpenedEventArgs openArgs)
|
||||
{
|
||||
void OnScreenClosed(object? closeSender, EventArgs args)
|
||||
void OnScreenClosed(object? closeSender, EventArgs closeArgs)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
namespace DiscordChatExporter.Gui.ViewModels.Messages;
|
||||
|
||||
public class NotificationMessage
|
||||
{
|
||||
public string Text { get; }
|
||||
|
||||
public NotificationMessage(string text) => Text = text;
|
||||
}
|
||||
public record NotificationMessage(string Text);
|
||||
@@ -62,9 +62,7 @@ public class RootViewModel : Screen, IHandle<NotificationMessage>, IDisposable
|
||||
_settingsService.Save();
|
||||
|
||||
if (await _dialogManager.ShowDialogAsync(dialog) == true)
|
||||
{
|
||||
ProcessEx.StartShellExecute("https://tyrrrz.me/ukraine?source=discordchatexporter");
|
||||
}
|
||||
}
|
||||
|
||||
private async ValueTask CheckForUpdatesAsync()
|
||||
@@ -106,7 +104,7 @@ public class RootViewModel : Screen, IHandle<NotificationMessage>, IDisposable
|
||||
|
||||
_settingsService.Load();
|
||||
|
||||
// Sync theme with settings
|
||||
// Sync the theme with settings
|
||||
if (_settingsService.IsDarkModeEnabled)
|
||||
{
|
||||
App.SetDarkTheme();
|
||||
@@ -116,7 +114,7 @@ public class RootViewModel : Screen, IHandle<NotificationMessage>, IDisposable
|
||||
App.SetLightTheme();
|
||||
}
|
||||
|
||||
// App has just been updated, display changelog
|
||||
// App has just been updated, display the changelog
|
||||
if (_settingsService.LastAppVersion is not null && _settingsService.LastAppVersion != App.Version)
|
||||
{
|
||||
Notifications.Enqueue(
|
||||
@@ -137,8 +135,7 @@ public class RootViewModel : Screen, IHandle<NotificationMessage>, IDisposable
|
||||
_updateService.FinalizeUpdate(false);
|
||||
}
|
||||
|
||||
public void Handle(NotificationMessage message) =>
|
||||
Notifications.Enqueue(message.Text);
|
||||
public void Handle(NotificationMessage message) => Notifications.Enqueue(message.Text);
|
||||
|
||||
public void Dispose() => Notifications.Dispose();
|
||||
}
|
||||
Reference in New Issue
Block a user