From 36b5b5088b99fe46a32556ff4c2f28a4dc12c3c7 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 6 Feb 2020 14:37:43 +1000 Subject: [PATCH] wrap invite copy navigator clipboard check --- client/src/events.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/events.jsx b/client/src/events.jsx index 72609eb0..6af704bd 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -166,9 +166,12 @@ function registerEvents(store) { function setInvite(code) { if (!code) return store.dispatch(actions.setInvite(null)); const link = `${document.location.origin}#join=${code}`; - navigator.clipboard.writeText(link).then(() => { - notify('Invite link copied to clipboard.'); - }, () => {}); + + if (navigator.clipboard) { + navigator.clipboard.writeText(link).then(() => { + notify('Invite link copied to clipboard.'); + }, () => {}); + } return store.dispatch(actions.setInvite(code)); }