Sync from GitHub main: v0.1.4 (#8)
This commit was merged in pull request #8.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>0.1.3</Version>
|
<Version>0.1.4</Version>
|
||||||
<Authors>Justin Paul</Authors>
|
<Authors>Justin Paul</Authors>
|
||||||
<Company>Justin Paul</Company>
|
<Company>Justin Paul</Company>
|
||||||
<Product>Webhook Server</Product>
|
<Product>Webhook Server</Product>
|
||||||
|
|||||||
@@ -82,8 +82,14 @@ public sealed partial class ConfigCheckpointsViewModel : ObservableObject
|
|||||||
{
|
{
|
||||||
if (Selected is null) return;
|
if (Selected is null) return;
|
||||||
|
|
||||||
|
// Capture before the refresh; the ObservableCollection.Clear() in
|
||||||
|
// RefreshAsync nulls Selected (the original instance is gone from the
|
||||||
|
// collection so the SelectedItem binding clears).
|
||||||
|
var fileName = Selected.FileName;
|
||||||
|
var savedAt = Selected.SavedAt;
|
||||||
|
|
||||||
var ok = MessageBox.Show(
|
var ok = MessageBox.Show(
|
||||||
$"Roll the configuration back to the checkpoint from {Selected.SavedAt.ToLocalTime():yyyy-MM-dd HH:mm:ss}?\n\nThe current configuration is automatically saved as a new checkpoint first, so you can roll forward again.",
|
$"Roll the configuration back to the checkpoint from {savedAt.ToLocalTime():yyyy-MM-dd HH:mm:ss}?\n\nThe current configuration is automatically saved as a new checkpoint first, so you can roll forward again.",
|
||||||
"Confirm rollback",
|
"Confirm rollback",
|
||||||
MessageBoxButton.OKCancel,
|
MessageBoxButton.OKCancel,
|
||||||
MessageBoxImage.Warning);
|
MessageBoxImage.Warning);
|
||||||
@@ -91,10 +97,10 @@ public sealed partial class ConfigCheckpointsViewModel : ObservableObject
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _client.RestoreBackupAsync(Selected.FileName).ConfigureAwait(false);
|
await _client.RestoreBackupAsync(fileName).ConfigureAwait(false);
|
||||||
await RefreshAsync().ConfigureAwait(false);
|
await RefreshAsync().ConfigureAwait(false);
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
StatusMessage = $"Rolled back to {Selected!.FileName}.");
|
StatusMessage = $"Rolled back to {fileName}.");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user