best check on telegramUsername exists

This commit is contained in:
Matteo Manzinello 2019-09-19 12:31:42 +02:00
parent d57a3f17bc
commit 1a57a77edb

View File

@ -453,17 +453,16 @@ const mailgoRender = (type = MAIL_TYPE, mailgo) => {
callButton = getE("mailgo-call");
copyButton = getE("mailgo-tel-copy");
if (telegramUsername) {
setDisplay("mailgo-telegram", "block");
}
// the title of the modal (tel)
titleEl.innerHTML = tel;
// add the actions to buttons
waButton.addEventListener("click", () => actions.openWhatsApp());
telegramButton.addEventListener("click", () => actions.openTelegram());
if (telegramUsername) {
setDisplay("mailgo-telegram", "block");
telegramButton.addEventListener("click", () => actions.openTelegram());
}
callButton.addEventListener("click", () => actions.callDefault());