aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/App.js
diff options
context:
space:
mode:
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 />