mirror of https://codeberg.org/pzp/zooboard.git
Allow pasting http invites
This commit is contained in:
parent
73bdf9ba96
commit
047718beb4
5
main.js
5
main.js
|
@ -228,7 +228,10 @@ async function handlePPPPPUri(ev, uri) {
|
|||
setTimeout(handlePPPPPUri, 100, null, uri)
|
||||
return
|
||||
}
|
||||
if (!uri.startsWith('ppppp://')) return console.log('Not a ppppp:// URI', uri)
|
||||
if (uri.startsWith("http:") || uri.startsWith("https://")) {
|
||||
uri = decodeURIComponent(uri.split('/invite#')[1])
|
||||
}
|
||||
if (!uri.startsWith('ppppp://')) return console.log('Not a ppppp invite URI', uri)
|
||||
const commands = peer.invite.parse(uri)
|
||||
for (const command of commands) {
|
||||
console.log('Executing command', JSON.stringify(command))
|
||||
|
|
|
@ -16,10 +16,10 @@ function JoinModal({ isOpen, onClose }) {
|
|||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose}>
|
||||
Insert here the ppppp:// invite code you received from your friend.
|
||||
Insert here the ppppp:// or http(s):// invite code you received from your friend.
|
||||
<textarea
|
||||
key="input"
|
||||
placeholder={'ppppp://...'}
|
||||
placeholder={'ppppp://... or http(s)://...'}
|
||||
className="border font-mono border-gray-400 resize-none rounded px-1 text-wrap break-all outline-offset-3 outline-2 outline-green-500 my-4 h-64"
|
||||
onChange={updateCode}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue