mirror of https://github.com/zulip/zulip.git
scheduled_messages_feed_ui: Convert module to TypeScript.
This commit is contained in:
parent
f0b8cc7865
commit
94558478df
|
@ -186,7 +186,7 @@ EXEMPT_FILES = make_set(
|
||||||
"web/src/resize_handler.js",
|
"web/src/resize_handler.js",
|
||||||
"web/src/rows.ts",
|
"web/src/rows.ts",
|
||||||
"web/src/scheduled_messages.ts",
|
"web/src/scheduled_messages.ts",
|
||||||
"web/src/scheduled_messages_feed_ui.js",
|
"web/src/scheduled_messages_feed_ui.ts",
|
||||||
"web/src/scheduled_messages_overlay_ui.js",
|
"web/src/scheduled_messages_overlay_ui.js",
|
||||||
"web/src/scheduled_messages_popover.js",
|
"web/src/scheduled_messages_popover.js",
|
||||||
"web/src/scheduled_messages_ui.js",
|
"web/src/scheduled_messages_ui.js",
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as channel from "./channel";
|
||||||
import {$t} from "./i18n";
|
import {$t} from "./i18n";
|
||||||
import * as timerender from "./timerender";
|
import * as timerender from "./timerender";
|
||||||
|
|
||||||
type ScheduledMessage = {
|
export type ScheduledMessage = {
|
||||||
scheduled_message_id: number;
|
scheduled_message_id: number;
|
||||||
content: string;
|
content: string;
|
||||||
rendered_content: string;
|
rendered_content: string;
|
||||||
|
|
|
@ -4,9 +4,10 @@ import render_scheduled_messages_indicator from "../templates/scheduled_messages
|
||||||
|
|
||||||
import * as narrow_state from "./narrow_state";
|
import * as narrow_state from "./narrow_state";
|
||||||
import * as scheduled_messages from "./scheduled_messages";
|
import * as scheduled_messages from "./scheduled_messages";
|
||||||
|
import type {ScheduledMessage} from "./scheduled_messages";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
|
|
||||||
function get_scheduled_messages_matching_narrow() {
|
function get_scheduled_messages_matching_narrow(): ScheduledMessage[] {
|
||||||
const scheduled_messages_list = [...scheduled_messages.scheduled_messages_data.values()];
|
const scheduled_messages_list = [...scheduled_messages.scheduled_messages_data.values()];
|
||||||
const filter = narrow_state.filter();
|
const filter = narrow_state.filter();
|
||||||
const is_conversation_view = filter === undefined ? false : filter.is_conversation_view();
|
const is_conversation_view = filter === undefined ? false : filter.is_conversation_view();
|
||||||
|
@ -55,7 +56,7 @@ function get_scheduled_messages_matching_narrow() {
|
||||||
return matching_scheduled_messages;
|
return matching_scheduled_messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update_schedule_message_indicator() {
|
export function update_schedule_message_indicator(): void {
|
||||||
$("#scheduled_message_indicator").empty();
|
$("#scheduled_message_indicator").empty();
|
||||||
const matching_scheduled_messages = get_scheduled_messages_matching_narrow();
|
const matching_scheduled_messages = get_scheduled_messages_matching_narrow();
|
||||||
const scheduled_message_count = matching_scheduled_messages.length;
|
const scheduled_message_count = matching_scheduled_messages.length;
|
Loading…
Reference in New Issue