mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-14 03:00:29 +03:00
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, useRef } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import './CreateRoom.scss';
|
||||
|
||||
import initMatrix from '../../../client/initMatrix';
|
||||
import cons from '../../../client/state/cons';
|
||||
import navigation from '../../../client/state/navigation';
|
||||
import { openReusableContextMenu } from '../../../client/action/navigation';
|
||||
|
|
@ -32,6 +31,7 @@ import SpaceGlobeIC from '../../../../public/res/ic/outlined/space-globe.svg';
|
|||
import ChevronBottomIC from '../../../../public/res/ic/outlined/chevron-bottom.svg';
|
||||
import CrossIC from '../../../../public/res/ic/outlined/cross.svg';
|
||||
import { useRoomNavigate } from '../../hooks/useRoomNavigate';
|
||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
|
||||
function CreateRoomContent({ isSpace, parentId, onRequestClose }) {
|
||||
const [joinRule, setJoinRule] = useState(parentId ? 'restricted' : 'invite');
|
||||
|
|
@ -46,7 +46,7 @@ function CreateRoomContent({ isSpace, parentId, onRequestClose }) {
|
|||
|
||||
const addressRef = useRef(null);
|
||||
|
||||
const mx = initMatrix.matrixClient;
|
||||
const mx = useMatrixClient();
|
||||
const userHs = getIdServer(mx.getUserId());
|
||||
|
||||
const handleSubmit = async (evt) => {
|
||||
|
|
@ -69,7 +69,7 @@ function CreateRoomContent({ isSpace, parentId, onRequestClose }) {
|
|||
const powerLevel = roleIndex === 1 ? 101 : undefined;
|
||||
|
||||
try {
|
||||
const data = await roomActions.createRoom({
|
||||
const data = await roomActions.createRoom(mx, {
|
||||
name,
|
||||
topic,
|
||||
joinRule,
|
||||
|
|
@ -113,7 +113,7 @@ function CreateRoomContent({ isSpace, parentId, onRequestClose }) {
|
|||
if (roomAlias === '') return;
|
||||
const roomAddress = `#${roomAlias}:${userHs}`;
|
||||
|
||||
if (await isRoomAliasAvailable(roomAddress)) {
|
||||
if (await isRoomAliasAvailable(mx, roomAddress)) {
|
||||
setIsValidAddress(true);
|
||||
} else {
|
||||
setIsValidAddress(false);
|
||||
|
|
@ -278,7 +278,7 @@ function useWindowToggle() {
|
|||
function CreateRoom() {
|
||||
const [create, onRequestClose] = useWindowToggle();
|
||||
const { isSpace, parentId } = create ?? {};
|
||||
const mx = initMatrix.matrixClient;
|
||||
const mx = useMatrixClient();
|
||||
const room = mx.getRoom(parentId);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue