Diff

mod_invites_page/html/invite.html @ 4134:82713dfee238

mod_invites_page: Fix platform detection and don't show empty list of clients for unknown platforms
author Matthew Wild <mwild1@gmail.com>
date Tue, 15 Sep 2020 16:27:48 +0100
parent 4131:330b1948bdc0
child 4172:740ca44eba06
line wrap: on
line diff
--- a/mod_invites_page/html/invite.html	Tue Sep 15 16:16:16 2020 +0100
+++ b/mod_invites_page/html/invite.html	Tue Sep 15 16:27:48 2020 +0100
@@ -147,10 +147,17 @@
 					if(platform.os.family.startsWith("Windows")) {
 						platform_friendly = "Windows";
 						platform_classname = "windows";
+					} else {
+						platform_friendly = platform.os.family;
+						platform_classname = platform_friendly.toLowerCase();
 					}
 				}
 
 				if(platform_friendly && platform_classname) {
+					if($('.client-card .client-platform-badge-'+platform_classname).length == 0) {
+						// No clients recognised for this platform, do nothing
+						return;
+					}
 					// Hide clients not for this platform
 					$('.client-card.app-platform-'+platform_classname).addClass("supported-platform");
 					$('.client-card').not(".supported-platform").hide();