Filter github providers.

This commit is contained in:
Yang Luo
2021-05-14 15:55:50 +08:00
parent fce4efcb84
commit 9346587ca6
4 changed files with 22 additions and 5 deletions

View File

@ -30,6 +30,23 @@ export function initServerUrl() {
}
}
function isLocalhost() {
const hostname = window.location.hostname;
return hostname === "localhost";
}
export function isProviderVisible(provider) {
if (provider.type !== "GitHub") {
return true;
}
if (isLocalhost()) {
return provider.name.includes("localhost");
} else {
return !provider.name.includes("localhost");
}
}
export function parseJson(s) {
if (s === "") {
return null;