diff options
author | Vitaly Takmazov | 2024-02-18 23:06:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-02-18 23:19:18 +0300 |
commit | 67f6f99665c0dfa3cbb0197d78e0e929b3d1ddee (patch) | |
tree | 6113cde5a6b02524dae8006117f5cbd909f9d59f /vnext/src/App.js | |
parent | b9bceb8e977de93dcdacec31c3f2de3af73760a7 (diff) |
vnext: fix login
Diffstat (limited to 'vnext/src/App.js')
-rw-r--r-- | vnext/src/App.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js index 9612bd83..befbb0ad 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -40,12 +40,17 @@ export default function App({ footer }) { let retpath = params['retpath'] || `${window.location.protocol}//${window.location.host}${window.location.pathname}` window.history.replaceState({}, document.title, retpath) }*/ - }, []) + }, [updateStatus]) let updateStatus = useCallback(() => { // refresh server visitor state (unread counters) - me().then(visitor => { - setVisitor(visitor) + me().then(response => { + setVisitor((prevState) => { + if (prevState !== response.data) { + return response.data + } + return prevState + }) }).catch(console.error) }, [setVisitor]) |