From 5d73bc22389a2606ecc630f88b6ec2328f690975 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Wed, 24 Aug 2022 15:43:25 -0700 Subject: [PATCH] fix: check perms to view watchlist slider on user profile (#2980) --- src/components/UserProfile/index.tsx | 66 +++++++++++++++------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/src/components/UserProfile/index.tsx b/src/components/UserProfile/index.tsx index 43b62fd5..26a78d76 100644 --- a/src/components/UserProfile/index.tsx +++ b/src/components/UserProfile/index.tsx @@ -294,36 +294,42 @@ const UserProfile = () => { /> )} - {(!watchlistItems || !!watchlistItems.results.length) && !watchlistError && ( - <> -
- - - {intl.formatMessage(messages.plexwatchlist)} - - - -
- ( - - ))} - /> - - )} + {(user.id === currentUser?.id || + currentHasPermission( + [Permission.MANAGE_REQUESTS, Permission.WATCHLIST_VIEW], + { type: 'or' } + )) && + (!watchlistItems || !!watchlistItems.results.length) && + !watchlistError && ( + <> +
+ + + {intl.formatMessage(messages.plexwatchlist)} + + + +
+ ( + + ))} + /> + + )} {(user.id === currentUser?.id || currentHasPermission(Permission.ADMIN)) && !!watchData?.recentlyWatched.length && (