Merge pull request #188 from jedmund/fix-182
Don't allow copying on new party page
This commit is contained in:
commit
a14d7ea9ce
1 changed files with 12 additions and 8 deletions
|
|
@ -95,16 +95,20 @@ const Header = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyToClipboard() {
|
function copyToClipboard() {
|
||||||
const el = document.createElement('input')
|
const path = router.asPath.split('/')[1]
|
||||||
el.value = window.location.href
|
|
||||||
el.id = 'url-input'
|
|
||||||
document.body.appendChild(el)
|
|
||||||
|
|
||||||
el.select()
|
if (path === 'p') {
|
||||||
document.execCommand('copy')
|
const el = document.createElement('input')
|
||||||
el.remove()
|
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) {
|
function handleNewParty(event: React.MouseEvent, path: string) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue