aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/App.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-20 00:17:46 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:59 +0300
commitd3cfc10a2087579f44b3bf91576c2f4ca518326a (patch)
treeccf716e03baec85fb516d9e7067daeb0fbf29cc7 /vnext/src/App.js
parentf06dbc1b6e99ad7735b9cfd4edd0efe2a835e2e2 (diff)
Minor fixes
Diffstat (limited to 'vnext/src/App.js')
-rw-r--r--vnext/src/App.js25
1 files changed, 13 insertions, 12 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 />