mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-06 06:45:18 -04:00
The 10th Polish Pass (#4349)
This commit is contained in:
@@ -141,6 +141,13 @@ public class LibraryController : BaseApiController
|
||||
|
||||
if (!await _unitOfWork.CommitAsync()) return BadRequest(await _localizationService.Translate(UserId, "generic-library"));
|
||||
|
||||
// I added this twice as some users were having issues where their new library wasn't added to the side nav.
|
||||
// I wasn't able to reproduce but could validate it didn't happen with this extra commit. (https://github.com/Kareadita/Kavita/issues/4248)
|
||||
if (_unitOfWork.HasChanges())
|
||||
{
|
||||
await _unitOfWork.CommitAsync();
|
||||
}
|
||||
|
||||
await _libraryCacheProvider.RemoveByPrefixAsync(CacheKey);
|
||||
|
||||
if (library.FolderWatching)
|
||||
@@ -485,7 +492,14 @@ public class LibraryController : BaseApiController
|
||||
|
||||
try
|
||||
{
|
||||
return Ok(await DeleteLibrary(libraryId, UserId));
|
||||
var result = await DeleteLibrary(libraryId, UserId);
|
||||
if (result)
|
||||
{
|
||||
// Inform the user's side nav to remove it if needed
|
||||
await _eventHub.SendMessageAsync(MessageFactory.SideNavUpdate,
|
||||
MessageFactory.SideNavUpdateEvent(UserId), false);
|
||||
}
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user