File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,7 @@ export default function IndexPage() {
171
171
} ,
172
172
} ) ;
173
173
174
- const [ currentlyTyping , setCurrentlyTyping ] = useState < string [ ] > ( [ ] ) ;
175
- trpc . post . whoIsTyping . useSubscription ( undefined , {
176
- onData ( data ) {
177
- setCurrentlyTyping ( data ) ;
178
- } ,
179
- } ) ;
174
+ const whoIsTypingResult = trpc . post . whoIsTyping . useSubscription ( ) ;
180
175
181
176
return (
182
177
< >
@@ -293,8 +288,8 @@ export default function IndexPage() {
293
288
< div className = "w-full" >
294
289
< AddMessageForm onMessagePost = { ( ) => scrollToBottomOfList ( ) } />
295
290
< p className = "h-2 italic text-gray-400" >
296
- { currentlyTyping . length
297
- ? `${ currentlyTyping . join ( ', ' ) } typing...`
291
+ { whoIsTypingResult . data ? .length
292
+ ? `${ whoIsTypingResult . data . join ( ', ' ) } typing...`
298
293
: '' }
299
294
</ p >
300
295
</ div >
You can’t perform that action at this time.
0 commit comments