From aa54fc4ea04f749befc010a3d750cbdb15aaff1f Mon Sep 17 00:00:00 2001
From: Michael Long <mlong@mlong.us>
Date: Fri, 1 Jan 2021 17:13:46 -0800
Subject: [PATCH] If you aren't using a custom xtrn menu head per section, then
 you might fall back on a global one...but the prior logic would not display
 the actual section heading if it used a global (xtrn_head) file. If you are
 using xtrn_head, you don't have anything in there with a section name, so
 display the section name from code again

---
 exec/xtrn_sec.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/exec/xtrn_sec.js b/exec/xtrn_sec.js
index e2b7540d21..4bbdf6578b 100644
--- a/exec/xtrn_sec.js
+++ b/exec/xtrn_sec.js
@@ -124,12 +124,15 @@ function external_program_menu(xsec)
 		var show_header = true;
 		var secnum = xtrn_area.sec_list[xsec].number+1;
 		var seccode = xtrn_area.sec_list[xsec].code;
-		if(!bbs.menu("xtrn" + secnum + "_head", P_NOERROR) &&
-			!bbs.menu("xtrn" + seccode + "_head", P_NOERROR)) {
-			show_header = !bbs.menu("xtrn_head", P_NOERROR);
-		}
-		else
+
+		if (bbs.menu("xtrn" + secnum + "_head", P_NOERROR) {
+			show_header = false;
+		} else if (bbs.menu("xtrn" + seccode + "_head", P_NOERROR)) {
 			show_header = false;
+		} else {
+			bbs.menu("xtrn_head", P_NOERROR);
+		}
+
 		if(bbs.menu("xtrn" + secnum, P_NOERROR) || bbs.menu("xtrn" + seccode, P_NOERROR)) {
 			if(!bbs.menu("xtrn" + secnum + "_tail", P_NOERROR) &&
 				!bbs.menu("xtrn" + seccode + "_tail", P_NOERROR)) {
-- 
GitLab