diff --git a/net/web/src/ConversationContext/useConversationContext.hook.js b/net/web/src/ConversationContext/useConversationContext.hook.js index 0a437e46..1078ed77 100644 --- a/net/web/src/ConversationContext/useConversationContext.hook.js +++ b/net/web/src/ConversationContext/useConversationContext.hook.js @@ -4,7 +4,6 @@ export function useConversationContext() { const [state, setState] = useState({}); useEffect(() => { - console.log("CREATED CONVERSATION"); }, []); const updateState = (value) => { diff --git a/net/web/src/Home/Home.jsx b/net/web/src/Home/Home.jsx index 9422992a..a0dab1e5 100644 --- a/net/web/src/Home/Home.jsx +++ b/net/web/src/Home/Home.jsx @@ -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') { diff --git a/net/web/src/User/SideBar/Identity/useIdentity.hook.js b/net/web/src/User/SideBar/Identity/useIdentity.hook.js index d0ab4bbb..c63ae5ff 100644 --- a/net/web/src/User/SideBar/Identity/useIdentity.hook.js +++ b/net/web/src/User/SideBar/Identity/useIdentity.hook.js @@ -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; diff --git a/net/web/src/VirtualList/VirtualList.jsx b/net/web/src/VirtualList/VirtualList.jsx index 97da9541..51e9df90 100644 --- a/net/web/src/VirtualList/VirtualList.jsx +++ b/net/web/src/VirtualList/VirtualList.jsx @@ -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(); } diff --git a/net/web/src/context/useAppContext.hook.js b/net/web/src/context/useAppContext.hook.js index 561c666c..85ac39e8 100644 --- a/net/web/src/context/useAppContext.hook.js +++ b/net/web/src/context/useAppContext.hook.js @@ -172,7 +172,7 @@ export function useAppContext() { if (state.access === 'admin') { return { state, actions: adminActions } } - return { actions: accessActions } + return { state, actions: accessActions } }