|
1 | 1 | import { |
2 | | - // createCommandInjectionMiddleware, |
3 | | - // createCommandStringExtractionMiddleware, |
4 | | - // createDraftCommandInjectionMiddleware, |
| 2 | + createCommandInjectionMiddleware, |
| 3 | + createCommandStringExtractionMiddleware, |
| 4 | + createDraftCommandInjectionMiddleware, |
5 | 5 | MessageComposer, |
6 | | - // TextComposerMiddleware, |
| 6 | + TextComposerMiddleware, |
7 | 7 | } from 'stream-chat'; |
8 | 8 |
|
9 | | -// TODO: Comment out once the commands PR has been merged on the LLC |
10 | | -// @ts-ignore |
11 | | -// eslint-disable-next-line @typescript-eslint/no-unused-vars |
12 | 9 | export const setupCommandUIMiddleware = (messageComposer: MessageComposer) => { |
13 | | - // TODO: Comment out once the commands PR has been merged on the LLC |
14 | | - // messageComposer.compositionMiddlewareExecutor.insert({ |
15 | | - // middleware: [createCommandInjectionMiddleware(messageComposer)], |
16 | | - // position: { after: 'stream-io/message-composer-middleware/attachments' }, |
17 | | - // }); |
18 | | - // |
19 | | - // messageComposer.draftCompositionMiddlewareExecutor.insert({ |
20 | | - // middleware: [createDraftCommandInjectionMiddleware(messageComposer)], |
21 | | - // position: { after: 'stream-io/message-composer-middleware/draft-attachments' }, |
22 | | - // }); |
23 | | - // |
24 | | - // messageComposer.textComposer.middlewareExecutor.insert({ |
25 | | - // middleware: [createCommandStringExtractionMiddleware() as TextComposerMiddleware], |
26 | | - // position: { after: 'stream-io/text-composer/commands-middleware' }, |
27 | | - // }); |
| 10 | + messageComposer.compositionMiddlewareExecutor.insert({ |
| 11 | + middleware: [createCommandInjectionMiddleware(messageComposer)], |
| 12 | + position: { after: 'stream-io/message-composer-middleware/attachments' }, |
| 13 | + }); |
| 14 | + |
| 15 | + messageComposer.draftCompositionMiddlewareExecutor.insert({ |
| 16 | + middleware: [createDraftCommandInjectionMiddleware(messageComposer)], |
| 17 | + position: { after: 'stream-io/message-composer-middleware/draft-attachments' }, |
| 18 | + }); |
| 19 | + |
| 20 | + messageComposer.textComposer.middlewareExecutor.insert({ |
| 21 | + middleware: [createCommandStringExtractionMiddleware() as TextComposerMiddleware], |
| 22 | + position: { after: 'stream-io/text-composer/commands-middleware' }, |
| 23 | + }); |
28 | 24 | }; |
0 commit comments