Skip to content

Commit 8845394

Browse files
committed
outbox [nfc]: Rely on stream_id to cut a hack in html generation
Much nicer! Simpler and more efficient. This takes care of the followup described here: #4899 (comment) which was the remaining open followup specifically mentioned on #3998.
1 parent 0466b1b commit 8845394

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/webview/html/header.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,7 @@ export default (
5555
`;
5656
} else if (headerStyle === 'full') {
5757
const streamName = streamNameOfStreamMessage(message);
58-
59-
// TODO(#3339): like `subscriptions.find(…)`, but for the values from …ById
60-
let stream = null;
61-
for (const sub of subscriptions.values()) {
62-
if (sub.name === streamName) {
63-
stream = sub;
64-
break;
65-
}
66-
}
58+
const stream = subscriptions.get(message.stream_id);
6759

6860
const backgroundColor = stream ? stream.color : 'hsl(0, 0%, 80%)';
6961
const textColor = foregroundColorFromBackground(backgroundColor);

0 commit comments

Comments
 (0)