Skip to content
Snippets Groups Projects
Commit cc4e9f13 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Fix channel join

parent 8d58b480
No related branches found
No related tags found
1 merge request!110Hot fixes for vite
......@@ -19,10 +19,10 @@ const Input: FC<Props> = ({ size = 'md', ...props }) => (
w-full block
rounded-[1.5rem]
px-4
bg-transparent
border border-[var(--charcoal-1)]
focus:outline-none focus:border-[var(--primary)]
placeholder:text-sm placeholder:text-[var(--charcoal-1)]
bg-charcoal-4
border border-charcoal-1
focus:outline-none focus:border-primary
placeholder:text-sm placeholder:text-charcoal-1
${sizeMap[size]}
${props.className || ''}
`}
......
......@@ -55,16 +55,44 @@ const CreateChannelView: FC = () => {
const onCreate = useCallback(async () => {
if (error) {
console.error('Validation error:', error);
return;
}
const trimmedName = channelName.trim();
// Log the actual values for debugging
console.log('Attempting to create channel with:', {
name: trimmedName,
nameLength: trimmedName.length,
description: channelDesc,
privacyLevel,
dmsEnabled
});
try {
createChannel(channelName, channelDesc, privacyLevel, dmsEnabled);
if (!trimmedName) {
alert({
type: 'error',
content: t('Channel name is required')
});
return;
}
if (!regex.test(trimmedName)) {
alert({
type: 'error',
content: t('Invalid channel name format')
});
return;
}
await createChannel(trimmedName, channelDesc, privacyLevel, dmsEnabled);
setChannelName('');
setChannelDesc('');
closeModal();
} catch (e) {
console.error((e as any).message);
console.error('Failed to create channel:', e);
alert({
type: 'error',
content: t('Something wrong happened, please check your details.')
......@@ -89,7 +117,17 @@ const CreateChannelView: FC = () => {
<ModalTitle>{t('Create New Space')}</ModalTitle>
<div className='space-y-4 w-full'>
<Input
className={cn({ 'border-red text-red placeholder:text-red': !!nameError })}
autoFocus
className={cn(`
focus:border-primary
focus-visible:outline-none w-full
rounded-2xl bg-charcoal-4 border border-charcoal-1 px-4 py-2
placeholder-charcoal-1 placeholder:text-sm
transition-all`,
{
'border-red text-red': !!nameError
}
)}
data-testid='channel-name-input'
type='text'
placeholder={t('Name')}
......@@ -103,8 +141,7 @@ const CreateChannelView: FC = () => {
onChange={onChannelNameChange}
/>
<textarea
className={cn(
`
className={cn(`
focus:border-primary
focus-visible:outline-none resize-none h-10 active:outline-0 w-full
rounded-2xl bg-charcoal-4 border border-charcoal-1 px-4 py-2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment