Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

muting: Refactor get_time_from_date_muted to util module.

Priyank Patel88b83de5bdd9
diff --git a/static/js/muting.js b/static/js/muting.js
index eeaf4a9e653..5b0d48e2889 100644
--- a/static/js/muting.js
+++ b/static/js/muting.js
@@ -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) {
diff --git a/static/js/util.js b/static/js/util.js
index 01f06d158a9..57c02f6e2d5 100644
--- a/static/js/util.js
+++ b/static/js/util.js
@@ -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;
+}