fix: copy invite link for HTTPS has deplicate origin (#3877)

This commit is contained in:
Ever 2024-04-26 15:19:30 +08:00 committed by GitHub
parent 7d711135bc
commit 2e454c770b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ const InvitationLink = ({
const selector = useRef(`invite-link-${randomString(4)}`)
const copyHandle = useCallback(() => {
copy(`${!value.url.includes('http://') ? window.location.origin : ''}${value.url}`)
copy(`${!value.url.startsWith('http') ? window.location.origin : ''}${value.url}`)
setIsCopied(true)
}, [value])