mirror of
https://github.com/vector-im/element-call.git
synced 2026-04-06 07:20:25 +00:00
not call registerPasswordlessUser where its called in a widget.
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -41,7 +41,9 @@ export function useRegisterPasswordlessUser(): UseRegisterPasswordlessUserType {
|
||||
throw new Error("No client context");
|
||||
}
|
||||
if (widget) {
|
||||
throw new Error("We never register passwordless user in widget");
|
||||
throw new Error(
|
||||
"Registration was skipped: We should never try to register password-less user in embedded mode.",
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -29,6 +29,7 @@ import { useOptInAnalytics } from "../settings/useSetting";
|
||||
import { HomePage } from "../home/HomePage";
|
||||
import { platform } from "../Platform";
|
||||
import { AppSelectionModal } from "./AppSelectionModal";
|
||||
import { widget } from "../widget";
|
||||
|
||||
export const RoomPage: FC = () => {
|
||||
const {
|
||||
@@ -62,7 +63,7 @@ export const RoomPage: FC = () => {
|
||||
useEffect(() => {
|
||||
// If we've finished loading, are not already authed and we've been given a display name as
|
||||
// a URL param, automatically register a passwordless user
|
||||
if (!loading && !authenticated && displayName) {
|
||||
if (!loading && !authenticated && displayName && !widget) {
|
||||
setIsRegistering(true);
|
||||
registerPasswordlessUser(displayName).finally(() => {
|
||||
setIsRegistering(false);
|
||||
|
||||
Reference in New Issue
Block a user