mirror of https://github.com/zulip/zulip.git
muting: Refactor get_time_from_date_muted to util module.
This function will be later needed again when we split the muted_users module from muting.
This commit is contained in:
parent
a254fa24ee
commit
88b83de5bd
|
@ -3,17 +3,11 @@ import {FoldDict} from "./fold_dict";
|
|||
import {page_params} from "./page_params";
|
||||
import * as stream_data from "./stream_data";
|
||||
import * as timerender from "./timerender";
|
||||
import {get_time_from_date_muted} from "./util";
|
||||
|
||||
const muted_topics = new Map();
|
||||
const muted_users = new Map();
|
||||
|
||||
function get_time_from_date_muted(date_muted) {
|
||||
if (date_muted === undefined) {
|
||||
return Date.now();
|
||||
}
|
||||
return date_muted * 1000;
|
||||
}
|
||||
|
||||
export function add_muted_topic(stream_id, topic, date_muted) {
|
||||
let sub_dict = muted_topics.get(stream_id);
|
||||
if (!sub_dict) {
|
||||
|
|
|
@ -354,3 +354,10 @@ export function filter_by_word_prefix_match(items, search_term, item_to_text) {
|
|||
|
||||
return filtered_items;
|
||||
}
|
||||
|
||||
export function get_time_from_date_muted(date_muted) {
|
||||
if (date_muted === undefined) {
|
||||
return Date.now();
|
||||
}
|
||||
return date_muted * 1000;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue