chore: hide discovery button if not pointing to Revolt

This commit is contained in:
Paul Makles 2022-08-15 19:32:02 +02:00
parent 353507e17a
commit 787d5840d2
5 changed files with 29 additions and 21 deletions

2
external/components vendored

@ -1 +1 @@
Subproject commit 8cdba8ded56d3c1a84d50330b58d71f74ea698bf
Subproject commit decc9ab0e6522c447195f3221e52e01dd327a98f

2
external/lang vendored

@ -1 +1 @@
Subproject commit bec6b0be505fdf89f15d0174391914cd73e14dc1
Subproject commit ab6e4e9a9b6260422265533867f01e58659f1576

View file

@ -9,6 +9,7 @@ import { useApplicationState } from "../../../mobx/State";
import { useClient } from "../../../controllers/client/ClientController";
import { modalController } from "../../../controllers/modals/ModalController";
import { IS_REVOLT } from "../../../version";
/**
* Server list sidebar shim component
@ -26,6 +27,8 @@ export default observer(() => {
[],
);
console.info("is_revolt", IS_REVOLT);
return (
<ServerList
client={client}
@ -35,6 +38,7 @@ export default observer(() => {
home={state.layout.getLastHomePath}
servers={state.ordering.orderedServers}
reorder={state.ordering.reorderServer}
showDiscovery={IS_REVOLT}
/>
);
});

View file

@ -14,6 +14,7 @@ import WaveSVG from "../../settings/assets/wave.svg";
import { clientController } from "../../../controllers/client/ClientController";
import { takeError } from "../../../controllers/client/jsx/error";
import { IS_REVOLT } from "../../../version";
import FormField from "../FormField";
import { CaptchaBlock, CaptchaProps } from "./CaptchaBlock";
import { MailProvider } from "./MailProvider";
@ -247,25 +248,23 @@ export const Form = observer(({ page, callback }: Props) => {
<Text id="login.resend" />
</Link>
</span>
{import.meta.env.VITE_API_URL &&
import.meta.env.VITE_API_URL !=
"https://api.revolt.chat" && (
<>
<br />
<Tip palette="primary">
<span>
<Text id="login.unofficial_instance" />{" "}
<a
href="https://developers.revolt.chat/faq/instances#what-is-a-third-party-instance"
style={{ color: "var(--accent)" }}
target="_blank"
rel="noreferrer">
<Text id="general.learn_more" />
</a>
</span>
</Tip>
</>
)}
{!IS_REVOLT && (
<>
<br />
<Tip palette="primary">
<span>
<Text id="login.unofficial_instance" />{" "}
<a
href="https://developers.revolt.chat/faq/instances#what-is-a-third-party-instance"
style={{ color: "var(--accent)" }}
target="_blank"
rel="noreferrer">
<Text id="general.learn_more" />
</a>
</span>
</Tip>
</>
)}
</>
)}
{(page === "reset" ||

View file

@ -1 +1,6 @@
export const APP_VERSION = "__APP_VERSION__";
export const IS_REVOLT =
import.meta.env.VITE_API_URL === "https://api.revolt.chat" ||
// future proofing
import.meta.env.VITE_API_URL === "https://app.revolt.chat/api" ||
import.meta.env.VITE_API_URL === "https://revolt.chat/api";