diff --git a/www/js/onboarding/WelcomePage.tsx b/www/js/onboarding/WelcomePage.tsx index ff8214578..36b27ded8 100644 --- a/www/js/onboarding/WelcomePage.tsx +++ b/www/js/onboarding/WelcomePage.tsx @@ -62,7 +62,9 @@ const WelcomePage = () => { } function pasteCode() { - window['cordova'].plugins.clipboard.paste((clipboardContent: string) => { + // if clipboard plugin not available, the callback will be a no-op + const pasteFn = window['cordova'].plugins.clipboard?.paste || ((cb) => cb('')); + pasteFn((clipboardContent: string) => { addStatReading('paste_token'); try { if (!clipboardContent?.startsWith('nrelop_') && !clipboardContent?.includes('://')) {