(channelId: string)
| 42 | const reconnectAttempts = new Map<string, number>(); |
| 43 | |
| 44 | function splitChannelId(channelId: string): { channelType: string; accountId?: string } { |
| 45 | const separatorIndex = channelId.indexOf('-'); |
| 46 | if (separatorIndex === -1) { |
| 47 | return { channelType: channelId }; |
| 48 | } |
| 49 | return { |
| 50 | channelType: channelId.slice(0, separatorIndex), |
| 51 | accountId: channelId.slice(separatorIndex + 1), |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | export const useChannelsStore = create<ChannelsState>((set, get) => ({ |
| 56 | channels: [], |