popovers: Use keys instead of names for tab navigation in profile modal.

We used name parameter in tab component callback to handle our
custom logic when switching tabs in profile modal. Using name
here invites a posible bug as these name are tagged for
translation. So to avoid this we switch to use key (html id
for these tabs) for this as they are always constant.
This commit is contained in:
m-e-l-u-h-a-n
2021-06-23 17:41:00 +05:30
committed by Tim Abbott
parent e10a315efd
commit 6cce478bce

View File

@@ -431,11 +431,11 @@ export function show_user_profile(user) {
callback(name, key) {
$(".tabcontent").hide();
$("#" + key).show();
switch (name) {
case "User groups":
switch (key) {
case "groups-tab":
render_user_group_list(groups_of_user, user);
break;
case "Streams":
case "streams-tab":
render_user_stream_list(user_streams, user);
break;
}