fix(channels): restrict available set to primary channels only (#63)

This commit is contained in:
paisley
2026-02-12 13:09:02 +08:00
committed by GitHub
Unverified
parent a8e26362b9
commit 8ade06d7b8

View File

@@ -37,7 +37,6 @@ import {
CHANNEL_NAMES, CHANNEL_NAMES,
CHANNEL_META, CHANNEL_META,
getPrimaryChannels, getPrimaryChannels,
getAllChannels,
type ChannelType, type ChannelType,
type Channel, type Channel,
type ChannelMeta, type ChannelMeta,
@@ -53,7 +52,6 @@ export function Channels() {
const [showAddDialog, setShowAddDialog] = useState(false); const [showAddDialog, setShowAddDialog] = useState(false);
const [selectedChannelType, setSelectedChannelType] = useState<ChannelType | null>(null); const [selectedChannelType, setSelectedChannelType] = useState<ChannelType | null>(null);
const [showAllChannels, setShowAllChannels] = useState(false);
const [configuredTypes, setConfiguredTypes] = useState<string[]>([]); const [configuredTypes, setConfiguredTypes] = useState<string[]>([]);
// Fetch channels on mount // Fetch channels on mount
@@ -94,7 +92,7 @@ export function Channels() {
}, [fetchChannels, fetchConfiguredTypes]); }, [fetchChannels, fetchConfiguredTypes]);
// Get channel types to display // Get channel types to display
const displayedChannelTypes = showAllChannels ? getAllChannels() : getPrimaryChannels(); const displayedChannelTypes = getPrimaryChannels();
// Connected/disconnected channel counts // Connected/disconnected channel counts
const connectedCount = channels.filter((c) => c.status === 'connected').length; const connectedCount = channels.filter((c) => c.status === 'connected').length;
@@ -228,13 +226,6 @@ export function Channels() {
{t('availableDesc')} {t('availableDesc')}
</CardDescription> </CardDescription>
</div> </div>
<Button
variant="ghost"
size="sm"
onClick={() => setShowAllChannels(!showAllChannels)}
>
{showAllChannels ? t('showLess') : t('showAll')}
</Button>
</div> </div>
</CardHeader> </CardHeader>
<CardContent> <CardContent>