fix(channels): update channel name assignment to use CHANNEL_NAMES for better clarity (#531)

This commit is contained in:
Haze
2026-03-16 18:17:59 +08:00
committed by GitHub
Unverified
parent f1e2e9fa01
commit db480dff17

View File

@@ -5,7 +5,7 @@
import { create } from 'zustand'; import { create } from 'zustand';
import { hostApiFetch } from '@/lib/host-api'; import { hostApiFetch } from '@/lib/host-api';
import { useGatewayStore } from './gateway'; import { useGatewayStore } from './gateway';
import type { Channel, ChannelType } from '../types/channel'; import { CHANNEL_NAMES, type Channel, type ChannelType } from '../types/channel';
interface AddChannelParams { interface AddChannelParams {
type: ChannelType; type: ChannelType;
@@ -109,7 +109,7 @@ export const useChannelsStore = create<ChannelsState>((set, get) => ({
channels.push({ channels.push({
id: `${channelId}-${primaryAccount?.accountId || 'default'}`, id: `${channelId}-${primaryAccount?.accountId || 'default'}`,
type: channelId as ChannelType, type: channelId as ChannelType,
name: primaryAccount?.name || channelId, name: primaryAccount?.name || CHANNEL_NAMES[channelId as ChannelType] || channelId,
status, status,
accountId: primaryAccount?.accountId, accountId: primaryAccount?.accountId,
error: error: