From 61709ea42ef3c06fe3acb2afba15c6989bc2ee14 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 3 May 2026 08:34:52 -0400 Subject: [PATCH] fix: Minor warnings on login screen (#12250) --- app/components/PluginIcon.tsx | 6 ++++-- app/scenes/Login/components/AuthenticationProvider.tsx | 5 +++-- app/utils/PluginManager.ts | 7 +++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/components/PluginIcon.tsx b/app/components/PluginIcon.tsx index b8027f63e5..a759b9324c 100644 --- a/app/components/PluginIcon.tsx +++ b/app/components/PluginIcon.tsx @@ -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; } diff --git a/app/scenes/Login/components/AuthenticationProvider.tsx b/app/scenes/Login/components/AuthenticationProvider.tsx index 82283c0966..f23ff39262 100644 --- a/app/scenes/Login/components/AuthenticationProvider.tsx +++ b/app/scenes/Login/components/AuthenticationProvider.tsx @@ -32,7 +32,8 @@ function AuthenticationProvider(props: Props) { const [isSubmitting, setSubmitting] = React.useState(false); const [email, setEmail] = React.useState(""); const formRef = React.useRef(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) => { @@ -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) { diff --git a/app/utils/PluginManager.ts b/app/utils/PluginManager.ts index cd49c7ec45..8f22d544d3 100644 --- a/app/utils/PluginManager.ts +++ b/app/utils/PluginManager.ts @@ -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[]>(); @observable