fix: Minor warnings on login screen (#12250)

This commit is contained in:
Tom Moor
2026-05-03 08:34:52 -04:00
committed by GitHub
parent f50bb00b29
commit 61709ea42e
3 changed files with 14 additions and 4 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
import { observer } from "mobx-react";
import styled from "styled-components";
import Logger from "~/utils/Logger";
import { Hook, usePluginValue } from "~/utils/PluginManager";
import { Hook, PluginManager, usePluginValue } from "~/utils/PluginManager";
type Props = {
/** The ID of the plugin to render an Icon for. */
@@ -26,7 +26,9 @@ function PluginIcon({ id, color, size = 24 }: Props) {
);
}
Logger.warn("No Icon registered for plugin", { id });
if (PluginManager.isLoaded) {
Logger.warn("No Icon registered for plugin", { id });
}
return null;
}
@@ -32,7 +32,8 @@ function AuthenticationProvider(props: Props) {
const [isSubmitting, setSubmitting] = React.useState(false);
const [email, setEmail] = React.useState("");
const formRef = React.useRef<HTMLFormElement>(null);
const { isCreate, id, name, authUrl, onEmailSuccess, ...rest } = props;
const { isCreate, id, name, authUrl, onEmailSuccess, preferOTP, ...rest } =
props;
const clientType = Desktop.isElectron() ? Client.Desktop : Client.Web;
const handleChangeEmail = (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -51,7 +52,7 @@ function AuthenticationProvider(props: Props) {
const response = await client.post(event.currentTarget.action, {
email,
client: clientType,
preferOTP: props.preferOTP,
preferOTP,
});
if (response.redirect) {
+7
View File
@@ -146,6 +146,13 @@ export class PluginManager {
this.loaded = true;
}
/**
* Whether all plugin client modules have finished loading.
*/
public static get isLoaded(): boolean {
return this.loaded;
}
private static plugins = observable.map<Hook, Plugin<Hook>[]>();
@observable