fix(ui): don't leave an orphaned list behind on cancel
"New list" pre-creates the DB row before opening List Settings. Cancelling or closing that modal left an untitled empty list behind; CreateListAsync now rolls the row back unless the modal reports Saved. Also moves the new-list/import-repo buttons up next to the "My Lists" label instead of a row below the list, and puts Notes above Important in the smart-list nav order.
This commit is contained in:
@@ -26,6 +26,10 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
// True after the list was deleted, so the caller reloads the list nav instead of refreshing the row.
|
||||
public bool Deleted { get; private set; }
|
||||
|
||||
// False when the modal closed via Cancel or the window chrome — CreateListAsync uses this to
|
||||
// roll the pre-created row back instead of leaving an untitled empty list behind.
|
||||
public bool Saved { get; private set; }
|
||||
|
||||
// Wired by the view to prompt yes/no before deleting and to surface a blocking-FK error.
|
||||
public Func<string, Task<bool>>? ConfirmAsync { get; set; }
|
||||
public Func<string, Task>? ShowErrorAsync { get; set; }
|
||||
@@ -149,6 +153,7 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
string.IsNullOrWhiteSpace(VerifyCommand) ? null : VerifyCommand,
|
||||
ticketProjectId);
|
||||
|
||||
Saved = true;
|
||||
CloseAction?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user