fix notification url replacement
This commit is contained in:
parent
8a5cd32be6
commit
4e41f67e87
@ -116,10 +116,6 @@ export default function Comment ({
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
ref.current.scrollIntoView({ behavior: 'instant', block: 'start' })
|
ref.current.scrollIntoView({ behavior: 'instant', block: 'start' })
|
||||||
ref.current.classList.add('outline-it')
|
ref.current.classList.add('outline-it')
|
||||||
router.replace({
|
|
||||||
pathname: router.pathname,
|
|
||||||
query: { id: router.query.id }
|
|
||||||
}, undefined, { scroll: false })
|
|
||||||
}, 20)
|
}, 20)
|
||||||
}
|
}
|
||||||
}, [item])
|
}, [item])
|
||||||
|
@ -329,8 +329,15 @@ export default function Notifications ({ ssrData }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (lastChecked && !checkedAt) {
|
if (lastChecked && !checkedAt) {
|
||||||
router.push({ query: { ...router.query, checkedAt: lastChecked } },
|
router.replace({
|
||||||
router.asPath, { shallow: true })
|
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({
|
client?.writeQuery({
|
||||||
query: HAS_NOTIFICATIONS,
|
query: HAS_NOTIFICATIONS,
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user