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.

inbox_util: Convert module to TypeScript.

Anders Kaseorga0656a6c5668
diff --git a/tools/test-js-with-node b/tools/test-js-with-node
index 82935c803f8..fd6610e031b 100755
--- a/tools/test-js-with-node
+++ b/tools/test-js-with-node
@@ -113,7 +113,7 @@ EXEMPT_FILES = make_set(
"web/src/hotkey.js",
"web/src/hotspots.js",
"web/src/inbox_ui.js",
- "web/src/inbox_util.js",
+ "web/src/inbox_util.ts",
"web/src/info_overlay.js",
"web/src/integration_url_modal.js",
"web/src/invite.ts",
diff --git a/web/src/inbox_util.js b/web/src/inbox_util.ts
similarity index 82%
rename from web/src/inbox_util.js
rename to web/src/inbox_util.ts
index 24e8b344314..23360a767a3 100644
--- a/web/src/inbox_util.js
+++ b/web/src/inbox_util.ts
@@ -5,15 +5,15 @@ import * as stream_data from "./stream_data";
let is_inbox_visible = false;
-export function set_visible(value) {
+export function set_visible(value: boolean): void {
is_inbox_visible = value;
}
-export function is_visible() {
+export function is_visible(): boolean {
return is_inbox_visible;
}
-export function update_stream_colors() {
+export function update_stream_colors(): void {
if (!is_visible()) {
return;
}
@@ -21,7 +21,7 @@ export function update_stream_colors() {
const $stream_headers = $("#inbox-streams-container .inbox-header");
$stream_headers.each((_index, stream_header) => {
const $stream_header = $(stream_header);
- const stream_id = Number.parseInt($stream_header.attr("data-stream-id"), 10);
+ const stream_id = Number.parseInt($stream_header.attr("data-stream-id")!, 10);
if (!stream_id) {
return;
}