Fix Installation Type dropdown hidden for Linux and macOS invites (#7791)
The d2ChangedInviteType() and d2ChangedInviteNameOs() functions used a condition of < 2 to determine whether to show the Installation Type dropdown. This only showed it for OS values 0 (Windows) and 1 (Windows x86), hiding it for Linux (2), macOS (4), and other non-Windows agents. Fixed by replacing the < 2 check with an allowlist indexOf() check: - d2agentInstallTypeDiv (agent type selector): show for [0,1,2,4] - d2agentInstallTypeDiv2 (invite name OS selector): show for [0,1,2,3] - d2agentInstallTypeDiv (standalone invite dialog): show for [0,1,2,4] Co-authored-by: Aaron <44r0n7+Claude@pm.me>
D1G1T4L3CH0 committed
May 16, 2026 at 04:24 UTC
fc4d713e4894ecb62ce9fb0535ec512444c7e287
1 file changed
+3
-3
views/default.handlebars
+3
-3
@@ -5662,10 +5662,10 @@
5662
if (features & 64) {
5663
QV('urlInviteDiv', Q('d2InviteType').value == 0);
5664
QV('d2agentexpirediv', Q('agentInviteNameOs').value == 4);
5665
- QV('d2agentInstallTypeDiv2', Q('agentInviteNameOs').value < 2);
5665
+ QV('d2agentInstallTypeDiv2', [0,1,2,3].indexOf(parseInt(Q('agentInviteNameOs').value)) > -1);
5666
QV('emailInviteDiv', Q('d2InviteType').value == 1);
5667
}
5668
- QV('d2agentInstallTypeDiv', parseInt(Q('d2agentType').value) < 2);
5668
+ QV('d2agentInstallTypeDiv', [0,1,2,4].indexOf(parseInt(Q('d2agentType').value)) > -1);
5669
validateAgentInvite();
5670
d2RequestInvitationLink();
5671
}
@@ -14887,7 +14887,7 @@
14887
QE('agentType', Q('agentJoinCheck').checked);
14888
QE('agentInviteType', Q('agentJoinCheck').checked);
14889
QE('idx_dlgOkButton', (Q('agentJoinCheck').checked == false) || (ok));
14890
- QV('d2agentInstallTypeDiv', parseInt(Q('agentType').value) < 2);
14890
+ QV('d2agentInstallTypeDiv', [0,1,2,4].indexOf(parseInt(Q('agentType').value)) > -1);
14891
}
14892
14893
function p20editmeshInviteCodeEx() {