From 1b2cfa5f05d3576612e7bf1e7c72b9d7d9c38163 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 10:34:49 +0000 Subject: [PATCH 1/2] Social Login support both https and mxc icons --- src/components/views/elements/SSOButtons.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index 57dd31f9d6..89356ecf5c 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -45,8 +45,13 @@ const SSOButton: React.FC = ({ }; let icon; - if (idp && idp.icon && idp.icon.startsWith("https://")) { - icon = {label}; + if (typeof idp?.icon === "string" && idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://")) { + icon = {label}; } const classes = classNames("mx_SSOButton", { From 2567fcd045c3888fdbb69901e56ba465053066e9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Dec 2020 12:02:16 +0000 Subject: [PATCH 2/2] add brackets for operator precedence --- src/components/views/elements/SSOButtons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index 89356ecf5c..2416e76119 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -45,7 +45,7 @@ const SSOButton: React.FC = ({ }; let icon; - if (typeof idp?.icon === "string" && idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://")) { + if (typeof idp?.icon === "string" && (idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://"))) { icon =