Skip to content

Commit

Permalink
fix(frontend): redirect report button to signin if needed (#2953)
Browse files Browse the repository at this point in the history
Fixes #2951
  • Loading branch information
Erb3 authored Dec 7, 2024
1 parent b8957d3 commit 88b1a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/frontend/src/pages/[type]/[id]/versions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -339,6 +340,7 @@ const props = defineProps({
const tags = useTags();
const flags = useFeatureFlags();
const formatRelativeTime = useRelativeTime();
const auth = await useAuth();
const emits = defineEmits(["onDownload"]);
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/pages/user/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 88b1a37

Please sign in to comment.