fix notification url replacement

This commit is contained in:
keyan 2023-08-03 18:04:43 -05:00
parent 8a5cd32be6
commit 4e41f67e87
2 changed files with 9 additions and 6 deletions

View File

@ -116,10 +116,6 @@ export default function Comment ({
setTimeout(() => {
ref.current.scrollIntoView({ behavior: 'instant', block: 'start' })
ref.current.classList.add('outline-it')
router.replace({
pathname: router.pathname,
query: { id: router.query.id }
}, undefined, { scroll: false })
}, 20)
}
}, [item])

View File

@ -329,8 +329,15 @@ export default function Notifications ({ ssrData }) {
useEffect(() => {
if (lastChecked && !checkedAt) {
router.push({ query: { ...router.query, checkedAt: lastChecked } },
router.asPath, { shallow: true })
router.replace({
pathname: router.pathname,
query: {
...router.query,
nodata: true, // make sure nodata is set so we don't fetch on back/forward
checkedAt: lastChecked
}
},
router.asPath, { ...router.options, shallow: true })
client?.writeQuery({
query: HAS_NOTIFICATIONS,
data: {