Remove some views and replace them with snackbar notifications

This commit is contained in:
Alexey Golub
2018-02-25 17:15:55 +02:00
parent 63e3ba8891
commit 656e5a5b0d
12 changed files with 10 additions and 181 deletions

View File

@@ -132,8 +132,7 @@ namespace DiscordChatExporter.Gui.ViewModels
// Notify user
MessengerInstance.Send(
new ShowNotificationMessage(
$"DiscordChatExporter v{lastVersion} has been downloaded. " +
"It will be installed once you exit.",
$"DiscordChatExporter v{lastVersion} has been downloaded it will be installed when you exit",
"INSTALL NOW",
async () =>
{
@@ -186,13 +185,13 @@ namespace DiscordChatExporter.Gui.ViewModels
}
catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Unauthorized)
{
const string message = "Unauthorized to perform request. Make sure token is valid.";
MessengerInstance.Send(new ShowErrorMessage(message));
const string message = "Unauthorized make sure the token is valid";
MessengerInstance.Send(new ShowNotificationMessage(message));
}
catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden)
{
const string message = "Forbidden to perform request. The account may be locked by 2FA.";
MessengerInstance.Send(new ShowErrorMessage(message));
const string message = "Forbidden account may be locked by 2FA";
MessengerInstance.Send(new ShowNotificationMessage(message));
}
AvailableGuilds = _guildChannelsMap.Keys.ToArray();
@@ -237,12 +236,14 @@ namespace DiscordChatExporter.Gui.ViewModels
await _exportService.ExportAsync(format, filePath, log);
// Notify completion
MessengerInstance.Send(new ShowExportDoneMessage(filePath));
MessengerInstance.Send(new ShowNotificationMessage($"Export completed for channel [{channel.Name}]",
"OPEN",
() => Process.Start(filePath)));
}
catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden)
{
const string message = "Forbidden to view messages in that channel.";
MessengerInstance.Send(new ShowErrorMessage(message));
const string message = "You don't have access to that channel";
MessengerInstance.Send(new ShowNotificationMessage(message));
}
IsBusy = false;