Fix app stuck on welcome screen in small device
This commit is contained in:
@@ -19,32 +19,22 @@ import navigation from '../../../client/state/navigation';
|
||||
import cons from '../../../client/state/cons';
|
||||
import DragDrop from '../../organisms/drag-drop/DragDrop';
|
||||
|
||||
const classNameHidden = 'client__item-hidden';
|
||||
|
||||
function Client() {
|
||||
const [isLoading, changeLoading] = useState(true);
|
||||
const [loadingMsg, setLoadingMsg] = useState('Heating up');
|
||||
const [dragCounter, setDragCounter] = useState(0);
|
||||
const classNameHidden = 'client__item-hidden';
|
||||
|
||||
/**
|
||||
* @type {React.MutableRefObject<HTMLDivElement>}
|
||||
*/
|
||||
const navWrapperRef = useRef(null);
|
||||
/**
|
||||
* @type {React.MutableRefObject<HTMLDivElement>}
|
||||
*/
|
||||
const roomWrapperRef = useRef(null);
|
||||
|
||||
// #region Liston on events for compact screen sizes
|
||||
function onRoomSelected() {
|
||||
// setActiveView(viewPossibilities.room);
|
||||
navWrapperRef.current.classList.add(classNameHidden);
|
||||
roomWrapperRef.current.classList.remove(classNameHidden);
|
||||
navWrapperRef.current?.classList.add(classNameHidden);
|
||||
roomWrapperRef.current?.classList.remove(classNameHidden);
|
||||
}
|
||||
function onNavigationSelected() {
|
||||
// setActiveView(viewPossibilities.nav);
|
||||
navWrapperRef.current.classList.remove(classNameHidden);
|
||||
roomWrapperRef.current.classList.add(classNameHidden);
|
||||
navWrapperRef.current?.classList.remove(classNameHidden);
|
||||
roomWrapperRef.current?.classList.add(classNameHidden);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -56,7 +46,6 @@ function Client() {
|
||||
navigation.removeListener(cons.events.navigation.NAVIGATION_OPENED, onNavigationSelected);
|
||||
});
|
||||
}, []);
|
||||
// #endregion
|
||||
|
||||
useEffect(() => {
|
||||
let counter = 0;
|
||||
@@ -98,7 +87,6 @@ function Client() {
|
||||
);
|
||||
}
|
||||
|
||||
// #region drag and drop
|
||||
function dragContainsFiles(e) {
|
||||
if (!e.dataTransfer.types) return false;
|
||||
|
||||
@@ -154,7 +142,6 @@ function Client() {
|
||||
initMatrix.roomsInput.setAttachment(roomId, file);
|
||||
initMatrix.roomsInput.emit(cons.events.roomsInput.ATTACHMENT_SET, file);
|
||||
}
|
||||
// #endregion
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user