From f8f7f485a402ad07f097948a285080ef83a77c77 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Thu, 7 Nov 2024 08:07:13 +0100 Subject: [PATCH] slug share workaround --- src/Components/Map/Subcomponents/ItemFormPopup.tsx | 5 +++-- .../Profile/Subcomponents/GroupSubHeaderView.tsx | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Components/Map/Subcomponents/ItemFormPopup.tsx b/src/Components/Map/Subcomponents/ItemFormPopup.tsx index 45a95ebc..cdc9e498 100644 --- a/src/Components/Map/Subcomponents/ItemFormPopup.tsx +++ b/src/Components/Map/Subcomponents/ItemFormPopup.tsx @@ -105,8 +105,8 @@ export function ItemFormPopup(props: ItemFormPopupProps) { toast.error(error.toString()) } if (success) { - props.layer.onlyOnePerOwner && item && updateItem({ ...item, ...formItem }) - ;(!props.layer.onlyOnePerOwner || !item) && + if (props.layer.onlyOnePerOwner && item) updateItem({ ...item, ...formItem }) + if (!props.layer.onlyOnePerOwner || !item) { addItem({ ...formItem, name: formItem.name ? formItem.name : user?.first_name, @@ -116,6 +116,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) { layer: props.layer, public_edit: !user, }) + } toast.success('New item created') resetFilterTags() } diff --git a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx index b3f919c9..5246fe03 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -26,7 +26,14 @@ export const GroupSubHeaderView = ({ )}
- +
)