From 4a1612c7dc8ba2af0d28ac71d5dfcdf059cd5ea0 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 21 Oct 2022 17:09:24 +0530 Subject: [PATCH] fix: item selection/unselection on deleting --- .../Controllers/ItemList/ItemListController.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web/src/javascripts/Controllers/ItemList/ItemListController.ts b/packages/web/src/javascripts/Controllers/ItemList/ItemListController.ts index 6e403e67f..5aab54e4a 100644 --- a/packages/web/src/javascripts/Controllers/ItemList/ItemListController.ts +++ b/packages/web/src/javascripts/Controllers/ItemList/ItemListController.ts @@ -401,13 +401,13 @@ export class ItemListController const activeItem = activeController?.item - if (this.shouldSelectActiveItem(activeItem) && activeItem) { + if (this.shouldCloseActiveItem(activeItem) && activeController) { + this.closeItemController(activeController) + this.selectionController.selectNextItem() + } else if (this.shouldSelectActiveItem(activeItem) && activeItem) { await this.selectionController.selectItem(activeItem.uuid).catch(console.error) } else if (this.shouldSelectFirstItem(itemsReloadSource)) { await this.selectFirstItem() - } else if (this.shouldCloseActiveItem(activeItem) && activeController) { - this.closeItemController(activeController) - this.selectionController.selectNextItem() } else if (this.shouldSelectNextItemOrCreateNewNote(activeItem)) { await this.selectNextItemOrCreateNewNote() }