File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,12 +25,10 @@ export default function App() {
2525 onKeyDown = { ( e ) => {
2626 if ( e . key === 'Enter' && promiseRef . current ) {
2727 e . preventDefault ( )
28- // `e.currentTarget` will be null after `await`
29- const _keyword = e . currentTarget . value
30- keyword = _keyword
28+ keyword = e . currentTarget . value
3129 promiseRef . current
3230 . then ( ( allComments ) => {
33- const comments = searchComments ( allComments , _keyword )
31+ const comments = searchComments ( allComments )
3432 setComments ( comments )
3533 } )
3634 . catch ( ( e ) => {
@@ -112,7 +110,7 @@ const CommentTree: React.FC<CommentProps> = ({ comments, sub = false }) => {
112110 )
113111}
114112
115- function searchComments ( allComments : Reply [ ] , keyword : string ) {
113+ function searchComments ( allComments : Reply [ ] ) {
116114 return allComments . filter ( ( comment ) => {
117115 return (
118116 comment . content . message . includes ( keyword ) ||
You can’t perform that action at this time.
0 commit comments