fix(archive): focus returns safely after a dialog; Retry of a relink asks for the folder again
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
3 files changed
+32
-9
No files matched your search
@@ -726,14 +726,10 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
|
||||
/// <summary>A moved archive keeps its id: opening it at the new root relinks every sequence (BRIEF §12.5 Move archive).</summary>
|
||||
private async Task RelinkAsync()
|
||||
{
|
||||
var folder = Services.Dialogs.PickFolder(Loc.L("Archive.Relink.Title"));
|
||||
if (folder is not null) await RelinkAsync(folder);
|
||||
}
|
||||
|
||||
private async Task RelinkAsync(string folder)
|
||||
{
|
||||
if (Services.Archives is not { } archives) return;
|
||||
var folder = Services.Dialogs.PickFolder(Loc.L("Archive.Relink.Title"));
|
||||
if (folder is null) return;
|
||||
try
|
||||
{
|
||||
var archive = await Task.Run(() => archives.OpenAsync(folder));
|
||||
@@ -747,7 +743,8 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or DatabaseException)
|
||||
{
|
||||
Log.Warning("archive", $"Relinking {folder} failed", ex);
|
||||
NotifyFailure("Archive.Relink.Failed", ex, new AsyncRelayCommand(() => RelinkAsync(folder)));
|
||||
// Retry asks for the folder again: the same one once its drive is back, or the right one.
|
||||
NotifyFailure("Archive.Relink.Failed", ex, RelinkCommand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user