diff options
author | Vitaly Takmazov | 2022-11-20 00:17:46 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:59 +0300 |
commit | d3cfc10a2087579f44b3bf91576c2f4ca518326a (patch) | |
tree | ccf716e03baec85fb516d9e7067daeb0fbf29cc7 | |
parent | f06dbc1b6e99ad7735b9cfd4edd0efe2a835e2e2 (diff) |
Minor fixes
-rw-r--r-- | vnext/src/App.js | 25 | ||||
-rw-r--r-- | vnext/src/ui/Feeds.js | 1 |
2 files changed, 13 insertions, 13 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js index bcd2b169..69ceb456 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -57,6 +57,18 @@ export default function App({ footer }) { const [eventSource, setEventSource] = /** @param EventSource? */ useState({}); + /** + * @param {import("./api").SecureUser} visitor + */ + let auth = useCallback((visitor) => { + setVisitor(prevState => { + if (visitor.hash != prevState.hash) { + setHash(visitor.hash); + } + return visitor; + }); + }, [setVisitor]); + useEffect(() => { let es; const anonymousUser = { @@ -90,7 +102,7 @@ export default function App({ footer }) { es.removeEventListener('msg', updateStatus); } }); - }, [hash, setVisitor, updateStatus]); + }, [auth, hash, setVisitor, updateStatus]); useEffect(() => { const getTrends = async () => { @@ -99,17 +111,6 @@ export default function App({ footer }) { getTrends().catch(console.error); }, []); - /** - * @param {import("./api").SecureUser} visitor - */ - let auth = useCallback((visitor) => { - setVisitor(prevState => { - if (visitor.hash != prevState.hash) { - setHash(visitor.hash); - } - return visitor; - }); - }, [setVisitor]); return ( <> <Header /> diff --git a/vnext/src/ui/Feeds.js b/vnext/src/ui/Feeds.js index d4b9e8c9..48da52e3 100644 --- a/vnext/src/ui/Feeds.js +++ b/vnext/src/ui/Feeds.js @@ -183,7 +183,6 @@ function Feed({ query }) { const { pageParam } = query; const lastMessage = data.slice(-1)[0] || {}; const nextpage = getPageParam(pageParam, lastMessage, new URLSearchParams(params)); - console.log('nextpage', nextpage); document.body.scrollTop = 0; document.documentElement.scrollTop = 0; setState((prevState) => { |