stream bar: Convert module to typescript.

This commit is contained in:
evykassirer
2023-12-22 15:17:04 -08:00
committed by Tim Abbott
parent c0cdfd78fb
commit d3b5a76a67
2 changed files with 4 additions and 3 deletions

View File

@@ -1,10 +1,11 @@
import * as stream_data from "./stream_data"; import * as stream_data from "./stream_data";
import {DEFAULT_COLOR} from "./stream_data";
// In an attempt to decrease mixing, set stream bar // In an attempt to decrease mixing, set stream bar
// color look like the stream being used. // color look like the stream being used.
// (In particular, if there's a color associated with it, // (In particular, if there's a color associated with it,
// have that color be reflected here too.) // have that color be reflected here too.)
export function decorate(stream_id, $element) { export function decorate(stream_id: number | undefined, $element: JQuery): void {
const color = stream_data.get_color(stream_id); const color = stream_id === undefined ? DEFAULT_COLOR : stream_data.get_color(stream_id);
$element.css("background-color", color); $element.css("background-color", color);
} }

View File

@@ -40,7 +40,7 @@ export type InviteStreamData = {
default_stream: boolean; default_stream: boolean;
}; };
const DEFAULT_COLOR = "#c2c2c2"; export const DEFAULT_COLOR = "#c2c2c2";
// Expose get_subscriber_count for our automated puppeteer tests. // Expose get_subscriber_count for our automated puppeteer tests.
export const get_subscriber_count = peer_data.get_subscriber_count; export const get_subscriber_count = peer_data.get_subscriber_count;