Don't allow copying on new party page

This commit is contained in:
Justin Edmund 2023-01-28 21:15:15 -08:00
parent 04227e5e47
commit 23353dd65e

View file

@ -95,16 +95,20 @@ const Header = () => {
}
function copyToClipboard() {
const el = document.createElement('input')
el.value = window.location.href
el.id = 'url-input'
document.body.appendChild(el)
const path = router.asPath.split('/')[1]
el.select()
document.execCommand('copy')
el.remove()
if (path === 'p') {
const el = document.createElement('input')
el.value = window.location.href
el.id = 'url-input'
document.body.appendChild(el)
setCopyToastOpen(true)
el.select()
document.execCommand('copy')
el.remove()
setCopyToastOpen(true)
}
}
function handleNewParty(event: React.MouseEvent, path: string) {