stream_edit: Don't set undefined text for email address.

`sub.email_address` can be `undefined`, `$foo.text(undefined)` has
no effect (it doesn't clear the text), and `text()` doesn't formally
accept `undefined`, so here we only call `text()` if the new value
isn't undefined.
This commit is contained in:
evykassirer 2024-11-03 11:37:15 -08:00 committed by Tim Abbott
parent 924ebee421
commit e739e9ae29
1 changed files with 3 additions and 1 deletions

View File

@ -109,7 +109,9 @@ export function open_edit_panel_empty() {
export function update_stream_name(sub, new_name) {
const $edit_container = stream_settings_containers.get_edit_container(sub);
if (sub.email_address !== undefined) {
$edit_container.find(".email-address").text(sub.email_address);
}
$edit_container.find(".sub-stream-name").text(new_name);
const active_data = stream_settings_components.get_active_data();