refactor: simplify modal handler wiring for rerender safety

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/15310f2a-9bf2-4813-b2be-7462cb923c9c

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-15 16:10:48 +00:00
committed by GitHub
parent 6ea8810881
commit 19273e6d10

View File

@@ -222,13 +222,13 @@ function openPortRequirementsModal(featureName, ports, onContinue) {
var continueBtn = onContinue
? '<button class="btn btn-primary" id="port-req-continue-btn">I Understand — Continue</button>'
: '';
function renderPortRequirements(internalIp) {
var rows = ports.map(function(p) {
return '<tr><td class="port-req-port">' + escHtml(p.port) + '</td>' +
'<td class="port-req-proto">' + escHtml(p.protocol) + '</td>' +
'<td class="port-req-desc">' + escHtml(p.description) + '</td></tr>';
}).join("");
function renderPortRequirements(internalIp) {
var ipLine = internalIp
? '<p class="port-req-intro">Forward each port below <strong>to this machine\'s internal IP: <code class="port-req-internal-ip">' + escHtml(internalIp) + '</code></strong></p>'
: "<p class=\"port-req-intro\">Forward each port below to this machine's internal LAN IP in your router's port forwarding settings.</p>";
@@ -251,15 +251,15 @@ function openPortRequirementsModal(featureName, ports, onContinue) {
continueBtn +
'</div>';
document.getElementById("port-req-dismiss-btn").addEventListener("click", function() {
document.getElementById("port-req-dismiss-btn").onclick = function() {
closePortRequirementsModal();
});
};
if (onContinue) {
document.getElementById("port-req-continue-btn").addEventListener("click", function() {
document.getElementById("port-req-continue-btn").onclick = function() {
closePortRequirementsModal();
onContinue();
});
};
}
}