mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	We split recent_topics module into recent_topics_(ui + data + util). This allows us to reduce cyclical dependencies which were created due to large list of imports in recent topics. Also, this refactor on its own makes sense.
		
			
				
	
	
		
			26 lines
		
	
	
		
			629 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			629 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import $ from "jquery";
 | 
						|
 | 
						|
import * as compose_state from "./compose_state";
 | 
						|
import * as overlays from "./overlays";
 | 
						|
import * as popovers from "./popovers";
 | 
						|
 | 
						|
export function is_visible() {
 | 
						|
    return $("#recent_topics_view").is(":visible");
 | 
						|
}
 | 
						|
 | 
						|
export function is_in_focus() {
 | 
						|
    // Check if user is focused on
 | 
						|
    // recent topics.
 | 
						|
    return (
 | 
						|
        is_visible() &&
 | 
						|
        !compose_state.composing() &&
 | 
						|
        !popovers.any_active() &&
 | 
						|
        !overlays.is_active() &&
 | 
						|
        !$(".home-page-input").is(":focus")
 | 
						|
    );
 | 
						|
}
 | 
						|
 | 
						|
export function get_topic_key(stream_id, topic) {
 | 
						|
    return stream_id + ":" + topic.toLowerCase();
 | 
						|
}
 |