mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	The original change in 5f127c85f7 was
intended to make the loop in message_lists.js not include a
potentially stale message_lists.current in the event that one is
viewing recent topics.
We revert that change and instead do the simpler thing of explicitly
checking whether we're viewing recent topics.
I was not able to prove this code was responsible for incidents this
week where all messages were marked as read while working in "Recent
topics", but is suspicious.
Likely the correct thing is to set message_lists.current to undefined
in this code path; I'm pretty sure it's an orphaned message list that
is no longer visible when viewing topics.
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			725 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			725 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import {Filter} from "./filter";
 | 
						|
import * as message_list from "./message_list";
 | 
						|
import * as recent_topics_util from "./recent_topics_util";
 | 
						|
 | 
						|
export let home;
 | 
						|
export let current;
 | 
						|
 | 
						|
export function set_current(msg_list) {
 | 
						|
    current = msg_list;
 | 
						|
}
 | 
						|
 | 
						|
export function all_rendered_message_lists() {
 | 
						|
    const rendered_message_lists = [home];
 | 
						|
    if (current !== home && !recent_topics_util.is_visible()) {
 | 
						|
        rendered_message_lists.push(current);
 | 
						|
    }
 | 
						|
    return rendered_message_lists;
 | 
						|
}
 | 
						|
 | 
						|
export function initialize() {
 | 
						|
    home = new message_list.MessageList({
 | 
						|
        table_name: "zhome",
 | 
						|
        filter: new Filter([{operator: "in", operand: "home"}]),
 | 
						|
        excludes_muted_topics: true,
 | 
						|
    });
 | 
						|
    current = home;
 | 
						|
}
 |