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.

sponsorship: Update discount description on page load.

Aman Agrawalbf53c70dd9c6
diff --git a/web/src/billing/sponsorship.ts b/web/src/billing/sponsorship.ts
index 3fa580585a1..a31fd09afa0 100644
--- a/web/src/billing/sponsorship.ts
+++ b/web/src/billing/sponsorship.ts
@@ -61,9 +61,14 @@ export function initialize(): void {
create_ajax_request();
});
- $<HTMLSelectElement>("#organization-type").on("change", (e) => {
- const string_value = $(e.currentTarget.selectedOptions).attr("data-string-value") ?? "";
- helpers.update_discount_details(string_value);
+ function update_discount_details(): void {
+ const selected_org_type = $<HTMLSelectElement>("#organization-type").find(":selected").attr("data-string-value") ?? "";
+ helpers.update_discount_details(selected_org_type);
+ }
+
+ update_discount_details();
+ $<HTMLSelectElement>("#organization-type").on("change", () => {
+ update_discount_details();
});
}