mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-31 07:00:26 +00:00
Enable lint rules for Promise handling to discourage misuse of them.
Squashed all of Hugh's commits into one.
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
MatrixClient,
|
||||
RegisterResponse,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { initClient } from "../utils/matrix";
|
||||
import { Session } from "../ClientContext";
|
||||
@@ -75,7 +76,7 @@ export const useInteractiveRegistration = (
|
||||
): Promise<[MatrixClient, Session]> => {
|
||||
const interactiveAuth = new InteractiveAuth({
|
||||
matrixClient: authClient.current!,
|
||||
doRequest: (auth): Promise<RegisterResponse> =>
|
||||
doRequest: async (auth): Promise<RegisterResponse> =>
|
||||
authClient.current!.registerRequest({
|
||||
username,
|
||||
password,
|
||||
@@ -87,17 +88,25 @@ export const useInteractiveRegistration = (
|
||||
}
|
||||
|
||||
if (nextStage === "m.login.terms") {
|
||||
interactiveAuth.submitAuthDict({
|
||||
type: "m.login.terms",
|
||||
});
|
||||
interactiveAuth
|
||||
.submitAuthDict({
|
||||
type: "m.login.terms",
|
||||
})
|
||||
.catch((e) => {
|
||||
logger.error(e);
|
||||
});
|
||||
} else if (nextStage === "m.login.recaptcha") {
|
||||
interactiveAuth.submitAuthDict({
|
||||
type: "m.login.recaptcha",
|
||||
response: recaptchaResponse,
|
||||
});
|
||||
interactiveAuth
|
||||
.submitAuthDict({
|
||||
type: "m.login.recaptcha",
|
||||
response: recaptchaResponse,
|
||||
})
|
||||
.catch((e) => {
|
||||
logger.error(e);
|
||||
});
|
||||
}
|
||||
},
|
||||
requestEmailToken: (): Promise<{ sid: string }> => {
|
||||
requestEmailToken: async (): Promise<{ sid: string }> => {
|
||||
return Promise.resolve({ sid: "dummy" });
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user