Polishing for Release (#1039)

* Rewrote the delete bookmarked page logic to be more precise with the way it deletes.

* Tell user migration email link is in log

* Fixed up the email service tooltip

* Tweaked messaging

* Removed some dead code from series detail page

* Default to SortName sorting when nothing is explicitly asked

* Updated typeahead to work with changes and fix enter on new/old items

* Cleaned up some extra logic in search result rendering code

* On super small screens (300px width or less), move the server settings to user dropdown
This commit is contained in:
Joseph Milazzo 2022-02-06 07:53:32 -08:00 committed by GitHub
parent c2f3e45a15
commit 4fffe1c404
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 176 additions and 124 deletions

View file

@ -560,13 +560,16 @@ namespace API.Controllers
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername(), AppUserIncludes.Bookmarks);
if (user.Bookmarks == null) return Ok();
try {
user.Bookmarks = user.Bookmarks.Where(x =>
x.ChapterId == bookmarkDto.ChapterId
&& x.AppUserId == user.Id
&& x.Page != bookmarkDto.Page).ToList();
try
{
var bookmarkToDelete = user.Bookmarks.SingleOrDefault(x =>
x.ChapterId == bookmarkDto.ChapterId && x.AppUserId == user.Id && x.Page == bookmarkDto.Page &&
x.SeriesId == bookmarkDto.SeriesId);
_unitOfWork.UserRepository.Update(user);
if (bookmarkToDelete != null)
{
_unitOfWork.UserRepository.Delete(bookmarkToDelete);
}
if (await _unitOfWork.CommitAsync())
{