-
-
Notifications
You must be signed in to change notification settings - Fork 827
Conversation
Also switch input to controlled so we re-render when it changes so we can show/hide the join button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor pedantry
} | ||
} | ||
|
||
_contentLooksLikeAlias() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's with some of the internal functions having _
, and some not? I'd prefer it if they all had _, but at least be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic, ftr, was treating functions passed to other bits (ie. the react callbacks) as public facing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but that's bogus :-p.
if (!this.input) return false; | ||
|
||
// liberal test for things that look like room aliases | ||
return /#.+:.+/.test(this.state.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this matches abc#def:abc
. You probably want /^#.+:/
ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise
if (!this.input) return false; | ||
|
||
// liberal test for things that look like room aliases | ||
return /^#.+:.+/.test(this.state.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing .+
is redundant now
Implement 'join' button that appears in room directory search box when you type a valid(ish) alias.
Also factors out the directory search box to a different component now it's a lot more complex (and also adds the clear button that was in the designs).
Fixes element-hq/element-web#2217