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.

user_profile: Update stream dropdown option value to be of "number" type.

Sahil Batra5c7756e1ef52
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index fbcf1c27a7e..00ee0e0d82b 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -209,6 +209,7 @@ function render_user_profile_subscribe_widget(): void {
get_options: get_user_unsub_streams,
item_click_callback: change_state_of_subscribe_button,
$events_container: $("#user-profile-modal"),
+ unique_id_type: dropdown_widget.DataTypes.NUMBER,
};
user_profile_subscribe_widget =
user_profile_subscribe_widget ?? new dropdown_widget.DropdownWidget(opts);
@@ -255,7 +256,7 @@ function reset_subscribe_widget(): void {
export function get_user_unsub_streams(): {
name: string;
- unique_id: string;
+ unique_id: number;
stream: StreamSubscription;
}[] {
const target_user_id = Number.parseInt($("#user-profile-modal").attr("data-user-id")!, 10);
@@ -263,7 +264,7 @@ export function get_user_unsub_streams(): {
.get_streams_for_user(target_user_id)
.can_subscribe.map((stream) => ({
name: stream.name,
- unique_id: stream.stream_id.toString(),
+ unique_id: stream.stream_id,
stream,
}))
.sort((a, b) => {