Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

eslint: Fix @typescript-eslint/prefer-optional-chain.

Anders Kaseorgb280843e515d
diff --git a/web/src/muted_users.ts b/web/src/muted_users.ts
index 00b97316e95..c377e33f920 100644
--- a/web/src/muted_users.ts
+++ b/web/src/muted_users.ts
@@ -64,9 +64,7 @@ export function set_muted_users(list: RawMutedUser[]): void {
muted_users.clear();
for (const user of list) {
- if (user !== undefined && user.id !== undefined) {
- add_muted_user(user.id, user.timestamp);
- }
+ add_muted_user(user.id, user.timestamp);
}
}
diff --git a/web/src/util.ts b/web/src/util.ts
index e7ea6627f43..5bdc1c41068 100644
--- a/web/src/util.ts
+++ b/web/src/util.ts
@@ -303,9 +303,7 @@ export function clean_user_content_links(html: string): string {
elt.removeAttribute("target");
}
- const is_inline_image =
- elt.parentElement && elt.parentElement.classList.contains("message_inline_image");
- if (is_inline_image) {
+ if (elt.parentElement?.classList.contains("message_inline_image")) {
// For inline images we want to handle the tooltips explicitly, and disable
// the browser's built in handling of the title attribute.
const title = elt.getAttribute("title");