From 558c2a0b2ef46cb19ecabef64e11f0b11ca9bd32 Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Fri, 9 Feb 2024 19:46:10 -0300
Subject: [PATCH] Make PermissionsViewer and ShowHiddenChannels default
dropdown change when clicked
---
.../permissionsViewer/components/UserPermissions.tsx | 1 +
.../components/HiddenChannelLockScreen.tsx | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/plugins/permissionsViewer/components/UserPermissions.tsx b/src/plugins/permissionsViewer/components/UserPermissions.tsx
index 3c6767713..bcd6bdf07 100644
--- a/src/plugins/permissionsViewer/components/UserPermissions.tsx
+++ b/src/plugins/permissionsViewer/components/UserPermissions.tsx
@@ -104,6 +104,7 @@ function UserPermissionsComponent({ guild, guildMember, showBorder }: { guild: G
guildMember.nick || UserStore.getUser(guildMember.userId).username
)
}
+ onDropDownClick={state => settings.store.defaultPermissionsDropdownState = !state}
defaultState={settings.store.defaultPermissionsDropdownState}
buttons={[
(
diff --git a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
index 87946110d..7904cd10b 100644
--- a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
+++ b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
@@ -120,7 +120,7 @@ const VideoQualityModesToNames = {
const HiddenChannelLogo = "/assets/433e3ec4319a9d11b0cbe39342614982.svg";
function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
- const [viewAllowedUsersAndRoles, setViewAllowedUsersAndRoles] = useState(settings.store.defaultAllowedUsersAndRolesDropdownState);
+ const { defaultAllowedUsersAndRolesDropdownState } = settings.use(["defaultAllowedUsersAndRolesDropdownState"]);
const [permissions, setPermissions] = useState([]);
const {
@@ -301,19 +301,19 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
)}
Allowed users and roles:
-
+
{({ onMouseLeave, onMouseEnter }) => (
- {viewAllowedUsersAndRoles && }
+ {defaultAllowedUsersAndRolesDropdownState && }