Don't leave UnauthenticatedView if there was a room creation error

This commit is contained in:
Robin Townsend
2022-05-17 12:34:05 -04:00
parent c13040f0b0
commit 1e5539f165
6 changed files with 52 additions and 45 deletions

View File

@@ -16,11 +16,9 @@ limitations under the License.
import matrix, { InteractiveAuth } from "matrix-js-sdk/src/browser-index";
import { useState, useEffect, useCallback, useRef } from "react";
import { useClient } from "../ClientContext";
import { initClient, defaultHomeserver } from "../matrix-utils";
export function useInteractiveRegistration() {
const { setClient } = useClient();
const [state, setState] = useState({ privacyPolicyUrl: "#", loading: false });
const authClientRef = useRef();
@@ -96,16 +94,14 @@ export function useInteractiveRegistration() {
session.tempPassword = password;
}
setClient(client, session);
const user = client.getUser(client.getUserId());
user.setRawDisplayName(displayName);
user.setDisplayName(displayName);
return client;
return [client, session];
},
[setClient]
[]
);
return [state, register];