mirror of https://github.com/zulip/zulip.git
typescript: Convert some && constructions to optional chains.
Some upcoming changes to how types are constructed are going to bring up these type linter errors, so fix them now.
This commit is contained in:
parent
e5dd75baf0
commit
808c24aef2
|
@ -428,8 +428,8 @@ export class MessageList {
|
|||
let deactivated = false;
|
||||
let just_unsubscribed = false;
|
||||
const subscribed = stream_data.is_subscribed(stream_id);
|
||||
const invite_only = sub && sub.invite_only;
|
||||
const is_web_public = sub && sub.is_web_public;
|
||||
const invite_only = sub?.invite_only;
|
||||
const is_web_public = sub?.is_web_public;
|
||||
const can_toggle_subscription =
|
||||
sub !== undefined && stream_data.can_toggle_subscription(sub);
|
||||
if (sub === undefined) {
|
||||
|
|
|
@ -323,7 +323,7 @@ function render_user_stream_list(streams: StreamSubscription[], user: User): voi
|
|||
filter: {
|
||||
$element: $("#user-profile-streams-tab .stream-search"),
|
||||
predicate(item, value) {
|
||||
return item && item.name.toLocaleLowerCase().includes(value);
|
||||
return item?.name.toLocaleLowerCase().includes(value);
|
||||
},
|
||||
onupdate() {
|
||||
if ($container.find(".empty-table-message").length) {
|
||||
|
|
Loading…
Reference in New Issue