mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fix logout issues
This commit is contained in:
parent
a5c1e6a05d
commit
764c777c0c
@ -4,7 +4,6 @@ export function useConversationContext() {
|
||||
const [state, setState] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
console.log("CREATED CONVERSATION");
|
||||
}, []);
|
||||
|
||||
const updateState = (value) => {
|
||||
|
@ -8,8 +8,8 @@ export function Home() {
|
||||
const app = useContext(AppContext);
|
||||
|
||||
useEffect(() => {
|
||||
if (app) {
|
||||
if (app.state == null) {
|
||||
if (app?.state) {
|
||||
if (app.state.access == null) {
|
||||
navigate('/login')
|
||||
}
|
||||
else if (app.state.access === 'user') {
|
||||
|
@ -34,6 +34,12 @@ export function useIdentity() {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (app.state && app.state.access != 'user') {
|
||||
navigate('/');
|
||||
}
|
||||
}, [app]);
|
||||
|
||||
useEffect(() => {
|
||||
if (profile?.state?.profile) {
|
||||
let identity = profile.state.profile;
|
||||
|
@ -5,7 +5,7 @@ import ReactResizeDetector from 'react-resize-detector';
|
||||
export function VirtualList({ id, items, itemRenderer }) {
|
||||
|
||||
const REDZONE = 256; // recenter on canvas if in canvas edge redzone
|
||||
const HOLDZONE = 512; // drop slots outside of holdzone of view
|
||||
const HOLDZONE = 1024; // drop slots outside of holdzone of view
|
||||
const OVERSCAN = 256; // add slots in overscan of view
|
||||
const DEFAULT_ITEM_HEIGHT = 64;
|
||||
const DEFAULT_LIST_HEIGHT = 4096;
|
||||
@ -143,7 +143,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
||||
addSlot(container.id, getSlot(container))
|
||||
anchorBottom.current = false;
|
||||
|
||||
if (containers.current[0].top + containers.current[0].height + 2 * GUTTER < scrollTop.current) {
|
||||
if (containers.current[0].top + containers.current[0].height + 2 * GUTTER + HOLDZONE < scrollTop.current) {
|
||||
removeSlot(containers.current[0].id);
|
||||
containers.current.shift();
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ export function useAppContext() {
|
||||
if (state.access === 'admin') {
|
||||
return { state, actions: adminActions }
|
||||
}
|
||||
return { actions: accessActions }
|
||||
return { state, actions: accessActions }
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user