invite link 1 click copy
This commit is contained in:
parent
04b60b758a
commit
5580f035df
@ -165,9 +165,9 @@ function registerEvents(store) {
|
|||||||
|
|
||||||
function setInvite(code) {
|
function setInvite(code) {
|
||||||
if (!code) return store.dispatch(actions.setInvite(null));
|
if (!code) return store.dispatch(actions.setInvite(null));
|
||||||
|
const link = `${document.location.origin}#join=${code}`;
|
||||||
navigator.clipboard.writeText(code).then(() => {
|
navigator.clipboard.writeText(link).then(() => {
|
||||||
notify(`your invite code ${code} was copied to the clipboard.`);
|
notify('Your invite code was copied to the clipboard.');
|
||||||
}, () => {});
|
}, () => {});
|
||||||
|
|
||||||
return store.dispatch(actions.setInvite(code));
|
return store.dispatch(actions.setInvite(code));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user