Skip to content

Commit

Permalink
Add Last test
Browse files Browse the repository at this point in the history
  • Loading branch information
jahongiry committed Feb 18, 2024
1 parent 501cf87 commit 9bcfe01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import UcOffer from './pages/offer/UcOffer';
function App() {
const dispatch = useDispatch();
const { pathname } = useLocation();
const token = useSelector((state) => state.auth.token);
const token = localStorage.getItem('token');

useEffect(() => {
const storedToken = localStorage.getItem('token');
if (storedToken) {
dispatch(checkLogIn());
}
}, [dispatch]);
}, [dispatch, token]);

useEffect(() => {
window.scrollTo(0, 0);
Expand Down
3 changes: 2 additions & 1 deletion src/pages/chat/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const Chat = () => {
useEffect(() => {
if (token) {
const newSocket = io('https://cyberswap.uz', {
path: '/api/socket.io',
query: { token: encodeURIComponent(token) },
transports: ['websocket'], // use WebSocket first, fallback to polling if necessary
transports: ['websocket'],
});
setSocket(newSocket);

Expand Down

0 comments on commit 9bcfe01

Please sign in to comment.