Skip to content

Commit

Permalink
fix: 🐛 fixes user specific features
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliosheinz committed Jan 22, 2023
1 parent b39c015 commit c7e9a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/modules/decks/actions-drop-down.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ export const ActionsDropDown = (props: ActionsDropDownProps) => {
}
},
},
]
].filter(({ isEnabled }) => isEnabled)

const hasEnabledActions = actions.some(({ isEnabled }) => isEnabled)

if (!hasEnabledActions) return null
if (actions.length === 0) return null

return (
<div className={className}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const studySessionRouter = createTRPCRouter({
)
.query(async ({ input: { deckId }, ctx }) => {
const studySession = await ctx.prisma.studySession.findFirst({
where: { deckId: deckId },
where: { deckId: deckId, deck: { ownerId: ctx.session.user.id } },
})

if (!studySession) return null
Expand Down

0 comments on commit c7e9a4e

Please sign in to comment.