mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-01-20 20:01:18 +00:00
slug share workaround
This commit is contained in:
parent
ba369e6d80
commit
f8f7f485a4
@ -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()
|
||||
}
|
||||
|
||||
@ -26,7 +26,14 @@ export const GroupSubHeaderView = ({
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<SocialShareBar url={shareBaseUrl + item.slug} title={item.name} />
|
||||
<SocialShareBar
|
||||
url={
|
||||
shareBaseUrl && item.slug
|
||||
? shareBaseUrl + item.slug
|
||||
: window.location.host + '/item/' + item.id
|
||||
}
|
||||
title={item.name}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user