Skip to content

Commit

Permalink
Merge pull request #1119 from The-Commit-Company/1117-unable-to-delet…
Browse files Browse the repository at this point in the history
…e-the-archived-channel

fix: allow admins to delete archived channels
  • Loading branch information
nikkothari22 authored Oct 18, 2024
2 parents 0f100fc + c6ef2e2 commit 53fc73e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/channel/ChannelRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 53fc73e

Please sign in to comment.