handle error in loading screen (#1823)
* handle client boot error in loading screen * use sync state hook in client root * add loading screen options * removed extra condition in loading finish * add sync connection status bar
This commit is contained in:
parent
e046c59f7c
commit
e2228a18c1
62 changed files with 609 additions and 510 deletions
|
|
@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import './JoinAlias.scss';
|
||||
|
||||
import initMatrix from '../../../client/initMatrix';
|
||||
import cons from '../../../client/state/cons';
|
||||
import navigation from '../../../client/state/navigation';
|
||||
import { join } from '../../../client/action/room';
|
||||
|
|
@ -18,6 +17,7 @@ import CrossIC from '../../../../public/res/ic/outlined/cross.svg';
|
|||
|
||||
import { useStore } from '../../hooks/useStore';
|
||||
import { useRoomNavigate } from '../../hooks/useRoomNavigate';
|
||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
|
||||
const ALIAS_OR_ID_REG = /^[#|!].+:.+\..+$/;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ function JoinAliasContent({ term, requestClose }) {
|
|||
const [process, setProcess] = useState(false);
|
||||
const [error, setError] = useState(undefined);
|
||||
|
||||
const mx = initMatrix.matrixClient;
|
||||
const mx = useMatrixClient();
|
||||
const mountStore = useStore();
|
||||
|
||||
const { navigateRoom } = useRoomNavigate();
|
||||
|
|
@ -63,7 +63,7 @@ function JoinAliasContent({ term, requestClose }) {
|
|||
}
|
||||
}
|
||||
try {
|
||||
const roomId = await join(alias, false, via);
|
||||
const roomId = await join(mx, alias, false, via);
|
||||
if (!mountStore.getItem()) return;
|
||||
openRoom(roomId);
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue