fix(frontend): redirect report button to signin if needed (#2953)

Fixes #2951
This commit is contained in:
Erb3
2024-12-07 20:45:32 +01:00
committed by GitHub
parent b8957d386a
commit 88b1a370d4
2 changed files with 4 additions and 2 deletions

View File

@@ -204,7 +204,8 @@
id: 'report',
color: 'red',
hoverFilled: true,
action: () => reportVersion(version.id),
action: () =>
auth.user ? reportVersion(version.id) : navigateTo('/auth/sign-in'),
shown: !currentMember,
},
{ divider: true, shown: currentMember },
@@ -339,6 +340,7 @@ const props = defineProps({
const tags = useTags();
const flags = useFeatureFlags();
const formatRelativeTime = useRelativeTime();
const auth = await useAuth();
const emits = defineEmits(["onDownload"]);

View File

@@ -68,7 +68,7 @@
{ divider: true, shown: auth.user && auth.user.id === user.id },
{
id: 'report',
action: () => reportUser(user.id),
action: () => (auth.user ? reportUser(user.id) : navigateTo('/auth/sign-in')),
color: 'red',
hoverOnly: true,
shown: auth.user?.id !== user.id,