You've already forked AstralRinth
forked from didirus/AstralRinth
fix(frontend): redirect report button to signin if needed (#2953)
Fixes #2951
This commit is contained in:
@@ -204,7 +204,8 @@
|
|||||||
id: 'report',
|
id: 'report',
|
||||||
color: 'red',
|
color: 'red',
|
||||||
hoverFilled: true,
|
hoverFilled: true,
|
||||||
action: () => reportVersion(version.id),
|
action: () =>
|
||||||
|
auth.user ? reportVersion(version.id) : navigateTo('/auth/sign-in'),
|
||||||
shown: !currentMember,
|
shown: !currentMember,
|
||||||
},
|
},
|
||||||
{ divider: true, shown: currentMember },
|
{ divider: true, shown: currentMember },
|
||||||
@@ -339,6 +340,7 @@ const props = defineProps({
|
|||||||
const tags = useTags();
|
const tags = useTags();
|
||||||
const flags = useFeatureFlags();
|
const flags = useFeatureFlags();
|
||||||
const formatRelativeTime = useRelativeTime();
|
const formatRelativeTime = useRelativeTime();
|
||||||
|
const auth = await useAuth();
|
||||||
|
|
||||||
const emits = defineEmits(["onDownload"]);
|
const emits = defineEmits(["onDownload"]);
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
{ divider: true, shown: auth.user && auth.user.id === user.id },
|
{ divider: true, shown: auth.user && auth.user.id === user.id },
|
||||||
{
|
{
|
||||||
id: 'report',
|
id: 'report',
|
||||||
action: () => reportUser(user.id),
|
action: () => (auth.user ? reportUser(user.id) : navigateTo('/auth/sign-in')),
|
||||||
color: 'red',
|
color: 'red',
|
||||||
hoverOnly: true,
|
hoverOnly: true,
|
||||||
shown: auth.user?.id !== user.id,
|
shown: auth.user?.id !== user.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user