From 5b9a91db858c66b8feeae7fe04ee1fc62757fc0a Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Thu, 17 Jun 2021 01:49:05 +0800 Subject: [PATCH] Fix bug in isProviderVisible(). --- web/src/Setting.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/web/src/Setting.js b/web/src/Setting.js index f19066c4..8bf73078 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -43,14 +43,18 @@ export function isProviderVisible(providerItem) { return false; } - if (providerItem.provider.type !== "GitHub") { - return true; + if (providerItem.provider.category !== "OAuth") { + return false; } - if (isLocalhost()) { - return providerItem.provider.name.includes("localhost"); + if (providerItem.provider.type === "GitHub") { + if (isLocalhost()) { + return providerItem.provider.name.includes("localhost"); + } else { + return !providerItem.provider.name.includes("localhost"); + } } else { - return !providerItem.provider.name.includes("localhost"); + return true; } }