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.

portico: Use jQuery better to select the first integration.

Alex Vandiver66de81425e45
diff --git a/web/src/portico/integrations.js b/web/src/portico/integrations.js
index 1f5ccb0b445..d83cfbda401 100644
--- a/web/src/portico/integrations.js
+++ b/web/src/portico/integrations.js
@@ -308,14 +308,7 @@ function toggle_categories_dropdown() {
function integration_events() {
$('#integration-search input[type="text"]').on("keypress", (e) => {
if (e.key === "Enter" && e.target.value !== "") {
- for (const integration_element of $(".integration-lozenges").children()) {
- const $integration = $(integration_element).find(".integration-lozenge");
-
- if ($integration.css("display") !== "none") {
- $integration.closest("a")[0].click();
- break;
- }
- }
+ $(".integration-lozenges .integration-lozenge:visible")[0]?.closest("a").click();
}
});