Fix types
This commit is contained in:
parent
004160b664
commit
81771f511c
5 changed files with 8 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
|||
},
|
||||
false // Don't need the crypto store just to log out
|
||||
);
|
||||
await client.logout(undefined, true);
|
||||
await client.logout(true);
|
||||
} catch (err_) {
|
||||
logger.warn(
|
||||
"The previous session was lost, and we couldn't log it out, " +
|
||||
|
|
@ -255,7 +255,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
|||
);
|
||||
|
||||
const logout = useCallback(async () => {
|
||||
await client.logout(undefined, true);
|
||||
await client.logout(true);
|
||||
await client.clearStores();
|
||||
clearSession();
|
||||
setState({
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const useInteractiveLogin = () =>
|
|||
password: string
|
||||
) => Promise<[MatrixClient, Session]>
|
||||
>(async (homeserver: string, username: string, password: string) => {
|
||||
const authClient = createClient(homeserver);
|
||||
const authClient = createClient({ baseUrl: homeserver });
|
||||
|
||||
const interactiveAuth = new InteractiveAuth({
|
||||
matrixClient: authClient,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const useInteractiveRegistration = (): [
|
|||
|
||||
const authClient = useRef<MatrixClient>();
|
||||
if (!authClient.current) {
|
||||
authClient.current = createClient(defaultHomeserver);
|
||||
authClient.current = createClient({ baseUrl: defaultHomeserver });
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,9 @@ export function useProfile(client: MatrixClient) {
|
|||
if (removeAvatar) {
|
||||
await client.setAvatarUrl("");
|
||||
} else if (avatar) {
|
||||
mxcAvatarUrl = await client.uploadContent(avatar);
|
||||
({ content_uri: mxcAvatarUrl } = await client.uploadContent(
|
||||
avatar
|
||||
));
|
||||
await client.setAvatarUrl(mxcAvatarUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function isIOS() {
|
|||
|
||||
export function usePageUnload(callback: () => void) {
|
||||
useEffect(() => {
|
||||
let pageVisibilityTimeout: number;
|
||||
let pageVisibilityTimeout: ReturnType<typeof setTimeout>;
|
||||
|
||||
function onBeforeUnload(event: PageTransitionEvent) {
|
||||
if (event.type === "visibilitychange") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue