Skip effect based register in widget mode. (#2230)
Prohibits error message. Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -21,6 +21,7 @@ import { createClient, MatrixClient } from "matrix-js-sdk/src/matrix";
|
|||||||
import { initClient } from "../matrix-utils";
|
import { initClient } from "../matrix-utils";
|
||||||
import { Session } from "../ClientContext";
|
import { Session } from "../ClientContext";
|
||||||
import { Config } from "../config/Config";
|
import { Config } from "../config/Config";
|
||||||
|
import { widget } from "../widget";
|
||||||
|
|
||||||
export const useInteractiveRegistration = (): {
|
export const useInteractiveRegistration = (): {
|
||||||
privacyPolicyUrl?: string;
|
privacyPolicyUrl?: string;
|
||||||
@@ -48,6 +49,7 @@ export const useInteractiveRegistration = (): {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (widget) return;
|
||||||
authClient.current!.registerRequest({}).catch((error) => {
|
authClient.current!.registerRequest({}).catch((error) => {
|
||||||
setPrivacyPolicyUrl(
|
setPrivacyPolicyUrl(
|
||||||
error.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url,
|
error.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user