From 6ea3b880f93e1d0dda2896aa441cdd1efa227a25 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 18 Oct 2020 12:45:42 +0300 Subject: [PATCH] Fix being able to access the changelog of deleted items. --- src/Calendars/Main.tsx | 28 +++++++++++++++------------- src/Contacts/Main.tsx | 28 +++++++++++++++------------- src/Pim/ItemChangeHistory.tsx | 5 +++++ src/Tasks/Main.tsx | 28 +++++++++++++++------------- 4 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/Calendars/Main.tsx b/src/Calendars/Main.tsx index 66755a1..280c3ed 100644 --- a/src/Calendars/Main.tsx +++ b/src/Calendars/Main.tsx @@ -134,6 +134,21 @@ export default function CalendarsMain() { history={history} /> + { + // We have this path outside because we don't want the item existing check + const [colUid, itemUid] = match.params.itemUid.split("|"); + const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; + if (!cachedCollection) { + return (); + } + + return ( + + ); + }} + /> { @@ -179,19 +194,6 @@ export default function CalendarsMain() { duplicate /> - { - const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; - if (!cachedCollection) { - return (); - } - - return ( - - ); - }} - /> + { + // We have this path outside because we don't want the item existing check + const [colUid, itemUid] = match.params.itemUid.split("|"); + const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; + if (!cachedCollection) { + return (); + } + + return ( + + ); + }} + /> { @@ -147,19 +162,6 @@ export default function ContactsMain() { history={history} /> - { - const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; - if (!cachedCollection) { - return (); - } - - return ( - - ); - }} - /> ); + } + if (!entries) { return ( diff --git a/src/Tasks/Main.tsx b/src/Tasks/Main.tsx index 8c76e58..e8d973e 100644 --- a/src/Tasks/Main.tsx +++ b/src/Tasks/Main.tsx @@ -120,6 +120,21 @@ export default function TasksMain() { history={history} /> + { + // We have this path outside because we don't want the item existing check + const [colUid, itemUid] = match.params.itemUid.split("|"); + const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; + if (!cachedCollection) { + return (); + } + + return ( + + ); + }} + /> { @@ -149,19 +164,6 @@ export default function TasksMain() { history={history} /> - { - const cachedCollection = cachedCollections!.find((x) => x.collection.uid === colUid)!; - if (!cachedCollection) { - return (); - } - - return ( - - ); - }} - />