Redirect to slug page

This commit is contained in:
Hongbo Wu 2022-05-04 12:12:20 +08:00
parent 80d0146f72
commit 329efacbe5

View file

@ -40,7 +40,6 @@ import { Label } from '../../../lib/networking/fragments/labelFragment'
import { isVipUser } from '../../../lib/featureFlag'
import { EmptyLibrary } from './EmptyLibrary'
import TopBarProgress from 'react-topbar-progress-indicator'
import { State } from '../../../lib/networking/fragments/articleFragment'
export type LayoutType = 'LIST_LAYOUT' | 'GRID_LAYOUT'
@ -259,15 +258,7 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
const username = viewerData?.me?.profile.username
if (username) {
setActiveCardId(item.node.id)
if (
item.node.state === State.PROCESSING &&
new Date(item.node.createdAt).getTime() >=
new Date().getTime() - 1000 * 30
) {
router.push(`/${username}/links/${item.node.id}`)
} else {
router.push(`/${username}/${item.node.slug}`)
}
router.push(`/${username}/${item.node.slug}`)
}
break
case 'showOriginal':