mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-12 02:00:28 +03:00
Fix app stuck on welcome screen in small device
This commit is contained in:
parent
74216f75e2
commit
53f1129242
7 changed files with 16 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue