Skip to content

Commit

Permalink
Remove fetch data
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackIQ committed Jul 27, 2022
1 parent 937db38 commit 4e7965f
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/pages/panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,16 @@ import {
TabPanel
} from "@mui/lab";

import {createUser} from "../redux/actions/user";
import TelegramTab from "./tabs/telegram";
import SettingsTab from "./tabs/settings";
import HomeTab from "./tabs/home";

const PanelPage = () => {
const dispatch = useDispatch();
const history = useHistory();

const session = useSelector(state => state.session);
if (!session) history.push('/auth');

const env = useSelector(state => state.env);

const uid = useSelector(state => state.uid);
const [user, setUser] = useState({});

useEffect(() => {
const userData = {
id: uid,
};

Axios.post(`${env.REACT_APP_BACKEND_API}/user/info`, userData)
.then((result) => {
const data = result.data;
dispatch(createUser(data));
setUser(data);
})
.catch((error) => {
console.log(error);
});
// eslint-disable-next-line
}, [user, uid]);

const [tab, setTab] = useState('1');
const changeTab = (event, newValue) => {
setTab(newValue);
Expand Down

0 comments on commit 4e7965f

Please sign in to comment.