Skip to content

Commit

Permalink
allow paste opcode to continue if clipboard Cordova plugin is missing
Browse files Browse the repository at this point in the history
Until we generate a new release of em-devapp, it does not have the cordova clipboard plugin.
To make local development easier I'm adding this small change that will allow auto-paste to be no-op if the clipboard plugin is not present; we then fall back to manual text entry of the opcode
  • Loading branch information
JGreenlee committed Dec 9, 2024
1 parent 970e50c commit 34fbe4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/js/onboarding/WelcomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('://')) {
Expand Down

0 comments on commit 34fbe4b

Please sign in to comment.