Skip to content

Commit bdc2bab

Browse files
committed
refactor(examples): remove unnecessary code from vite/App.tsx
1 parent 8184914 commit bdc2bab

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

examples/vite/src/App.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,14 @@ const userId = parseUserIdFromToken(userToken);
4848
const filters: ChannelFilters = {
4949
members: { $in: [userId] },
5050
type: 'messaging',
51-
// archived: false,
51+
archived: false,
5252
};
5353
const options: ChannelOptions = { limit: 5, presence: true, state: true };
5454
const sort: ChannelSort = { pinned_at: 1, last_message_at: -1, updated_at: -1 };
5555

5656
// @ts-ignore
5757
const isMessageAIGenerated = (message: LocalMessage) => !!message?.ai_generated;
5858

59-
const Btn = ({ sendMessage }: SendButtonProps) => {
60-
const messageComposer = useMessageComposer();
61-
return (
62-
<button
63-
onClick={(e) => {
64-
messageComposer.customDataManager.setData({ a: 'b' });
65-
sendMessage(e);
66-
}}
67-
>
68-
Submit
69-
</button>
70-
);
71-
};
72-
7359
const App = () => {
7460
const chatClient = useCreateChatClient({
7561
apiKey,
@@ -88,9 +74,6 @@ const App = () => {
8874
position: { before: 'stream-io/text-composer/mentions-middleware' },
8975
unique: true,
9076
});
91-
composer.attachmentManager.setCustomUploadFn(async (fileLike) => {
92-
return composer.attachmentManager.doDefaultUploadRequest(fileLike);
93-
});
9477
});
9578
}, [chatClient]);
9679

@@ -109,7 +92,7 @@ const App = () => {
10992
showChannelSearch
11093
additionalChannelSearchProps={{ searchForChannels: true }}
11194
/>
112-
<Channel emojiSearchIndex={SearchIndex} SendButton={Btn}>
95+
<Channel emojiSearchIndex={SearchIndex}>
11396
<Window>
11497
<ChannelHeader Avatar={ChannelAvatar} />
11598
<MessageList returnAllReadData />

0 commit comments

Comments
 (0)