From c6ef2e28177582200afac15b4289c5d179cea368 Mon Sep 17 00:00:00 2001 From: Nikhil Kothari Date: Fri, 18 Oct 2024 16:22:16 +0530 Subject: [PATCH] fix: allow admins to delete archived channels --- .../components/feature/channels/ViewChannelDetailsModal.tsx | 3 +-- frontend/src/utils/channel/ChannelRedirect.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/feature/channels/ViewChannelDetailsModal.tsx b/frontend/src/components/feature/channels/ViewChannelDetailsModal.tsx index 6851ab264..00b2344d6 100644 --- a/frontend/src/components/feature/channels/ViewChannelDetailsModal.tsx +++ b/frontend/src/components/feature/channels/ViewChannelDetailsModal.tsx @@ -63,8 +63,7 @@ const ViewChannelDetailsModalContent = ({ setOpen, channelData }: ViewChannelDet }, [setOpen]) // channel settings are only available for admins - // the general channel is the default channel and cannot be deleted or archived - const allowSettingChange = (channelMembers[currentUser]?.is_admin == 1 && channelData.name != 'general' && channelData.is_archived == 0) || false + const allowSettingChange = (channelMembers[currentUser]?.is_admin == 1) || false return ( <> diff --git a/frontend/src/utils/channel/ChannelRedirect.tsx b/frontend/src/utils/channel/ChannelRedirect.tsx index 4a751dc86..00b1cb165 100644 --- a/frontend/src/utils/channel/ChannelRedirect.tsx +++ b/frontend/src/utils/channel/ChannelRedirect.tsx @@ -12,7 +12,7 @@ import { ChannelListProvider } from './ChannelListProvider' */ export const ChannelRedirect = () => { - const lastChannel = localStorage.getItem('ravenLastChannel') ?? 'general' + const lastChannel = localStorage.getItem('ravenLastChannel') ?? '' const navigate = useNavigate() const { pathname } = useLocation()