mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
feat(asset): link to assets on notification cards. (#451)
* feat(asset): link to assets on notification cards. * Update packages/webui/components/notification-card.tsx Co-authored-by: Yiling-J <njjyl723@gmail.com> --------- Co-authored-by: Yiling-J <njjyl723@gmail.com>
This commit is contained in:
@@ -136,13 +136,19 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
|
|||||||
|
|
||||||
const hasPreview = asset?.preview && (asset.proxyType === 'image' || asset.proxyType === 'video')
|
const hasPreview = asset?.preview && (asset.proxyType === 'image' || asset.proxyType === 'video')
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (kanbanTask?.id && team?.id) {
|
if (kanbanTask?.id && team?.id) {
|
||||||
navigate({
|
navigate({
|
||||||
to: '/teams/$teamId/kanban',
|
to: '/teams/$teamId/kanban',
|
||||||
params: { teamId: team.id },
|
params: { teamId: team.id },
|
||||||
search: { taskId: kanbanTask.id },
|
search: { taskId: kanbanTask.id },
|
||||||
})
|
})
|
||||||
|
}else if(project?.id && asset?.id){
|
||||||
|
//TODO: Perhaps it should be marked as read too when redirecting to it.
|
||||||
|
navigate({
|
||||||
|
to: '/projects/$projectId/files/$fileId',
|
||||||
|
params: { projectId: project.id, fileId: asset.id },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user