mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
some build cleanup
This commit is contained in:
parent
7145542874
commit
d480bb754b
@ -34,12 +34,6 @@ export function useAdmin() {
|
||||
check();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (app.state.adminToken) {
|
||||
navigate('/dashboard');
|
||||
}
|
||||
}, [app.state]);
|
||||
|
||||
const actions = {
|
||||
setPassword: (password) => {
|
||||
updateState({ password });
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useContext, useRef, useState, useEffect } from 'react';
|
||||
import { useContext, useState, useEffect } from 'react';
|
||||
import { getNodeConfig } from 'api/getNodeConfig';
|
||||
import { setNodeConfig } from 'api/setNodeConfig';
|
||||
import { getNodeAccounts } from 'api/getNodeAccounts';
|
||||
@ -42,6 +42,7 @@ export function useDashboard() {
|
||||
syncConfig();
|
||||
syncAccounts();
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
}, [app]);
|
||||
|
||||
const actions = {
|
||||
|
@ -1,8 +1,5 @@
|
||||
import { useEffect, useContext } from 'react';
|
||||
import { Drawer, Spin } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { SessionWrapper } from './Session.styled';
|
||||
import { AppContext } from 'context/AppContext';
|
||||
import { useSession } from './useSession.hook';
|
||||
import { Conversation } from './conversation/Conversation';
|
||||
import { Details } from './details/Details';
|
||||
@ -19,14 +16,6 @@ import { BottomNav } from './bottomNav/BottomNav';
|
||||
export function Session() {
|
||||
|
||||
const { state, actions } = useSession();
|
||||
const app = useContext(AppContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (!app.state.status) {
|
||||
navigate('/');
|
||||
}
|
||||
}, [app, navigate]);
|
||||
|
||||
const closeAccount = () => {
|
||||
actions.closeProfile();
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { useContext, useState, useEffect, useRef } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { AppContext } from 'context/AppContext';
|
||||
import { CardContext } from 'context/CardContext';
|
||||
import { StoreContext } from 'context/StoreContext';
|
||||
import { ViewportContext } from 'context/ViewportContext';
|
||||
@ -23,12 +25,15 @@ export function useSession() {
|
||||
loading: false,
|
||||
});
|
||||
|
||||
const app = useContext(AppContext);
|
||||
const card = useContext(CardContext);
|
||||
const store = useContext(StoreContext);
|
||||
const viewport = useContext(ViewportContext);
|
||||
const channel = useContext(ChannelContext);
|
||||
const profile = useContext(ProfileContext);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const storeStatus = useRef(null);
|
||||
const cardStatus = useRef(0);
|
||||
|
||||
@ -45,6 +50,13 @@ export function useSession() {
|
||||
}
|
||||
}, [card, channel, profile]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!app.state.status) {
|
||||
navigate('/');
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
}, [app.state]);
|
||||
|
||||
useEffect(() => {
|
||||
updateState({ display: viewport.state.display });
|
||||
}, [viewport]);
|
||||
|
Loading…
Reference in New Issue
Block a user