Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onInfoButtonTap(contactInfo: ContactInfo) {
const phone = contactInfo.displayString.replace(/\s/g, "");
if (contactInfo.type === 0) {
phoneModule.dial(phone, true);
} else if (contactInfo.type === 1) {
phoneModule.sms([phone], "");
} else {
const composeOptions: email.ComposeOptions = {
to: [contactInfo.displayString]
};
email.available().then((available: boolean) => {
if (available) {
email.compose(composeOptions);
}
});
}
}
}
title: 'Error',
message: 'There was an issue sending the email.',
okButtonText: 'Ok'
});
});
}, () => {
dialogs.alert({
title: 'Error',
message: 'Email is not available',
okButtonText: 'Ok'
});
});
}
else if (selectedAction.startsWith('Call')) {
const formattedPhone = contact.phone.replace(/ /g, '').replace(/["'()]/g, '').replace(/-/g, '');
phone.dial(formattedPhone, true);
}
}
});
}
onInfoButtonTap(contactInfo: ContactInfo) {
const phone = contactInfo.displayString.replace(/\s/g, "");
if (contactInfo.type === 0) {
phoneModule.dial(phone, true);
} else if (contactInfo.type === 1) {
phoneModule.sms([phone], "");
} else {
const composeOptions: email.ComposeOptions = {
to: [contactInfo.displayString]
};
email.available().then((available: boolean) => {
if (available) {
email.compose(composeOptions);
}
});
}
}
}