Fix #574 (for realsies this time)

This commit is contained in:
Mbucari 2023-04-10 15:00:32 -06:00
parent 6800986f25
commit 8a1b375f0d
2 changed files with 8 additions and 4 deletions

View File

@ -58,7 +58,7 @@ namespace LibationUiBase.GridView
public abstract object BackgroundBrush { get; } public abstract object BackgroundBrush { get; }
public object ButtonImage => GetLiberateIcon(); public object ButtonImage => GetLiberateIcon();
public string ToolTip => GetTooltip(); public string ToolTip => GetTooltip();
protected internal Book Book { get; internal set; } internal Book Book { get; }
private DateTime lastBookUpdate; private DateTime lastBookUpdate;
private LiberatedStatus bookStatus; private LiberatedStatus bookStatus;

View File

@ -154,9 +154,13 @@ namespace LibationUiBase.GridView
if (udi.Book.AudibleProductId != Book.AudibleProductId) if (udi.Book.AudibleProductId != Book.AudibleProductId)
return; return;
//If UserDefinedItem was changed on a different Book instance (such as when batch liberating via menus), if (udi.Book != LibraryBook.Book)
//EntryStatus' Book instance will not have the current DB state. {
Liberate.Book = udi.Book; //If UserDefinedItem was changed on a different Book instance (such as when batch liberating via menus),
//Liberate.Book and LibraryBook.Book instances will not have the current DB state.
Invoke(() => UpdateLibraryBook(new LibraryBook(udi.Book, LibraryBook.DateAdded, LibraryBook.Account)));
return;
}
// UDI changed, possibly in a different context/view. Update this viewmodel. Call NotifyPropertyChanged to notify view. // UDI changed, possibly in a different context/view. Update this viewmodel. Call NotifyPropertyChanged to notify view.
// - This method responds to tons of incidental changes. Do not persist to db from here. Committing to db must be a volitional action by the caller, not incidental. Otherwise batch changes would be impossible; we would only have slow one-offs // - This method responds to tons of incidental changes. Do not persist to db from here. Committing to db must be a volitional action by the caller, not incidental. Otherwise batch changes would be impossible; we would only have slow one-offs