Skip to content

Commit

Permalink
fix: only show users' requests badge if count > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RaunoT committed Oct 30, 2024
1 parent 48a17df commit f021269
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ public/swe-worker-*.js

#config
config/settings.json
config/settings-backup.json
2 changes: 1 addition & 1 deletion src/app/dashboard/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function DashboardUsersContent({ searchParams }: Props) {
}

const session = await getServerSession(authOptions)
const loggedInUserId = session?.user?.id
const loggedInUserId = session?.user.id
const period = getPeriod(searchParams, settings)
const [usersData, totalDuration, usersCount, totalRequests] =
await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion src/app/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function SettingsLayout({ children }: Props) {
const missingSetting = checkRequiredSettings(settings)

if (
!session?.user?.isAdmin &&
!session?.user.isAdmin &&
missingSetting !== 'connection.tautulliUrl' &&
missingSetting !== 'connection.tautulliApiKey'
) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MediaItem/MediaItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default function MediaItem({
</li>
)}
{/* Requests */}
{activeStats.includes('requests') && isUsers && isOverseerrActive && (
{activeStats.includes('requests') && isUsers && data.requests > 0 && (
<li className='icon-stat-wrapper'>
<QuestionMarkCircleIcon />
{pluralize(data.requests, 'request')}
Expand Down

0 comments on commit f021269

Please sign in to comment.