mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
message_list_data_cache: Update when receiving new messages.
If we receive a message that we can add to the data cache without talking to the server, we do that, otherwise we remove it from the cache to avoid us having wrong filter status cached.
This commit is contained in:
@@ -88,3 +88,12 @@ export function get_superset_datasets(filter: Filter): MessageListData[] {
|
||||
|
||||
return [...superset_datasets, all_messages_data.all_messages_data];
|
||||
}
|
||||
|
||||
export function remove(filter: Filter): void {
|
||||
for (const [key, cached_data] of cache.entries()) {
|
||||
if (cached_data.filter.equals(filter)) {
|
||||
cache.delete(key);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user