diff --git a/components/notifications.js b/components/notifications.js
index c4a352d4..f6b348f4 100644
--- a/components/notifications.js
+++ b/components/notifications.js
@@ -42,9 +42,9 @@ function NotificationLayout ({ children, nid, href, as }) {
return (
{
+ onClick={async (e) => {
if (ignoreClick(e)) return
- nid && router.replace({
+ nid && await router.replace({
pathname: router.pathname,
query: {
...router.query,
@@ -348,8 +348,7 @@ export default function Notifications ({ ssrData }) {
nodata: true, // make sure nodata is set so we don't fetch on back/forward
checkedAt: lastChecked
}
- },
- router.asPath, { ...router.options, shallow: true })
+ }, router.asPath, { ...router.options, shallow: true })
client?.writeQuery({
query: HAS_NOTIFICATIONS,
data: {
@@ -361,8 +360,9 @@ export default function Notifications ({ ssrData }) {
const [fresh, old] = useMemo(() => {
if (!notifications) return [[], []]
+ const freshTime = checkedAt || lastChecked
return notifications.reduce((result, n) => {
- result[new Date(n.sortTime).getTime() > new Date(checkedAt)?.getTime() ? 0 : 1].push(n)
+ result[new Date(n.sortTime).getTime() > new Date(freshTime)?.getTime() ? 0 : 1].push(n)
return result
},
[[], []])
diff --git a/lib/apollo.js b/lib/apollo.js
index 665c533e..83f36b12 100644
--- a/lib/apollo.js
+++ b/lib/apollo.js
@@ -29,7 +29,6 @@ function getClient (uri) {
return new ApolloClient({
link: new HttpLink({ uri }),
ssrMode: SSR,
- ssrForceFetchDelay: 100,
cache: new InMemoryCache({
freezeResults: true,
typePolicies: {
diff --git a/pages/_app.js b/pages/_app.js
index 4914287b..b29475d9 100644
--- a/pages/_app.js
+++ b/pages/_app.js
@@ -25,7 +25,6 @@ function writeQuery (client, apollo, data) {
query: gql`${apollo.query}`,
data,
variables: apollo.variables,
- broadcast: !SSR,
overwrite: SSR
})
}