diff --git a/conversations.php b/conversations.php index 72fd276..16f98d6 100644 --- a/conversations.php +++ b/conversations.php @@ -2011,8 +2011,12 @@ // templates loaded into select by loadQuickReplies // show template container only if templates exist const tplContainer = document.getElementById('templateSelectContainer'); - if (tplContainer && document.getElementById('templateSelect').children.length) { - tplContainer.style.display = (document.getElementById('message-type').value === 'template') ? 'inline-block' : 'none'; + const tplSelect = document.getElementById('templateSelect'); + const typeSelect = document.getElementById('message-type'); + if (tplContainer && tplSelect && tplSelect.children.length) { + // If message-type selector exists, show only when 'template' is selected. Otherwise show (legacy/simple UI). + const showTpl = typeSelect ? (typeSelect.value === 'template') : true; + tplContainer.style.display = showTpl ? 'inline-block' : 'none'; } // Initialize recording handlers so the mic works even before opening a conversation