diff options
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]) |