Fix redirect after deleting item (#5930)

* Fix redirect after deleting item

Redirects to the parent of an item instead of homepage after deleting the item

* Revert "Fix redirect after deleting item"

This reverts commit 6e36915f5e510ca3dc67a0a713322baec2ec159e.

* Fix redirect after deleting item

Redirects to the parent of an item instead of homepage
after deleting the item
This commit is contained in:
DrWarpMan
2024-08-23 20:17:59 +02:00
committed by GitHub
parent 18ddf4956a
commit 5bd61d82a3
+7 -1
View File
@@ -2021,7 +2021,13 @@ export default function (view, params) {
itemContextMenu.show(getContextMenuOptions(selectedItem, user, button))
.then(function (result) {
if (result.deleted) {
appRouter.goHome();
const parentId = selectedItem.SeasonId || selectedItem.SeriesId || selectedItem.ParentId;
if (parentId) {
appRouter.showItem(parentId, item.ServerId);
} else {
appRouter.goHome();
}
} else if (result.updated) {
reload(self, view, params);
}