Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions core-web/src/components/Messages/MessagesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ export default function MessagesView() {
const [newChannelName, setNewChannelName] = useState("");
const [newChannelDescription, setNewChannelDescription] = useState("");
const [newChannelPrivate, setNewChannelPrivate] = useState(false);
const [isCreatingChannel, setIsCreatingChannel] = useState(false);
const [editingMessageId, setEditingMessageId] = useState<string | null>(null);
const [editingContent, setEditingContent] = useState("");
const [workspaceMembers, setWorkspaceMembers] = useState<
Expand Down Expand Up @@ -1977,8 +1978,9 @@ export default function MessagesView() {

const handleCreateChannel = async (e: React.FormEvent) => {
e.preventDefault();
if (!newChannelName.trim()) return;
if (!newChannelName.trim() || isCreatingChannel) return;

setIsCreatingChannel(true);
try {
const channel = await addChannel(
newChannelName,
Expand All @@ -1992,6 +1994,8 @@ export default function MessagesView() {
navigateToChannel(channel.id);
} catch (err) {
console.error("Failed to create channel:", err);
} finally {
setIsCreatingChannel(false);
}
};

Expand Down Expand Up @@ -3152,10 +3156,10 @@ export default function MessagesView() {
</button>
<button
type="submit"
disabled={!newChannelName.trim()}
disabled={!newChannelName.trim() || isCreatingChannel}
className="px-3 py-2 text-[12px] font-medium bg-gray-900 text-white rounded-lg hover:bg-gray-800 disabled:opacity-40 disabled:cursor-not-allowed transition-all"
>
Create
{isCreatingChannel ? 'Creating...' : 'Create'}
</button>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ export default function CreateProjectModal({
</button>
<button
type="submit"
disabled={!name.trim()}
disabled={!name.trim() || createBoard.isPending}
className="px-3 py-2 text-[12px] font-medium bg-gray-900 text-white rounded-lg hover:bg-gray-800 disabled:opacity-40 disabled:cursor-not-allowed transition-all"
>
Create
{createBoard.isPending ? 'Creating...' : 'Create'}
</button>
</div>
</form>
Expand Down
Loading