mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	This applies the fixes we have when restoring scroll position and marking messages as read in background for overlays to modals.
		
			
				
	
	
		
			32 lines
		
	
	
		
			713 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			713 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import $ from "jquery";
 | 
						|
 | 
						|
import * as compose_state from "./compose_state";
 | 
						|
import * as overlays from "./overlays";
 | 
						|
import * as popovers from "./popovers";
 | 
						|
 | 
						|
let is_rt_visible = false;
 | 
						|
 | 
						|
export function set_visible(value) {
 | 
						|
    is_rt_visible = value;
 | 
						|
}
 | 
						|
 | 
						|
export function is_visible() {
 | 
						|
    return is_rt_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_overlay_or_modal_open() &&
 | 
						|
        !$(".home-page-input").is(":focus")
 | 
						|
    );
 | 
						|
}
 | 
						|
 | 
						|
export function get_topic_key(stream_id, topic) {
 | 
						|
    return stream_id + ":" + topic.toLowerCase();
 | 
						|
}
 |