Browse Source

alphabetize channels

drawing-pad
Stephanie Gredell 1 month ago
parent
commit
41e1e3b2b0
  1. 5
      frontend/src/hooks/useChannels.ts

5
frontend/src/hooks/useChannels.ts

@ -13,7 +13,10 @@ export function useChannels() {
try { try {
const response: any = await channelsApi.getAll(); const response: any = await channelsApi.getAll();
setChannels(response.data.channels); const sortedChannels = [...response.data.channels].sort((a: Channel, b: Channel) =>
a.name.localeCompare(b.name, undefined, { sensitivity: 'base' })
);
setChannels(sortedChannels);
} catch (err: any) { } catch (err: any) {
setError(err.error?.message || 'Failed to fetch channels'); setError(err.error?.message || 'Failed to fetch channels');
} finally { } finally {

Loading…
Cancel
Save