mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Minor warnings on login screen (#12250)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user