Skip to content

Commit 239997c

Browse files
Adjust common custom data & error type
1 parent 9500f99 commit 239997c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import 'stream-chat';
22

33
declare module 'stream-chat' {
4-
interface CustomUserData {
5-
image?: string;
6-
}
7-
84
interface CustomChannelData {
95
image?: string;
6+
name?: string;
107
subtitle?: string;
118
}
129
}

src/components/ChannelList/hooks/usePaginatedChannels.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import uniqBy from 'lodash.uniqby';
44
import { MAX_QUERY_CHANNELS_LIMIT } from '../utils';
55

66
import type {
7+
APIErrorResponse,
78
Channel,
89
ChannelFilters,
910
ChannelOptions,
1011
ChannelSort,
12+
ErrorFromResponse,
1113
StreamChat,
1214
} from 'stream-chat';
1315

@@ -106,9 +108,9 @@ export const usePaginatedChannels = (
106108
activeChannelHandler(newChannels, setChannels);
107109
}
108110
}
109-
} catch (err) {
110-
console.warn(err);
111-
setError(err as Error);
111+
} catch (error) {
112+
console.warn(error);
113+
setError(error as ErrorFromResponse<APIErrorResponse>);
112114
}
113115

114116
setQueryInProgress(null);

0 commit comments

Comments
 (0)