mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							e10a315efd
						
					
				
				
					commit
					6cce478bce
				
			@@ -431,11 +431,11 @@ export function show_user_profile(user) {
 | 
				
			|||||||
        callback(name, key) {
 | 
					        callback(name, key) {
 | 
				
			||||||
            $(".tabcontent").hide();
 | 
					            $(".tabcontent").hide();
 | 
				
			||||||
            $("#" + key).show();
 | 
					            $("#" + key).show();
 | 
				
			||||||
            switch (name) {
 | 
					            switch (key) {
 | 
				
			||||||
                case "User groups":
 | 
					                case "groups-tab":
 | 
				
			||||||
                    render_user_group_list(groups_of_user, user);
 | 
					                    render_user_group_list(groups_of_user, user);
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case "Streams":
 | 
					                case "streams-tab":
 | 
				
			||||||
                    render_user_stream_list(user_streams, user);
 | 
					                    render_user_stream_list(user_streams, user);
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user