Use Set() for condensed types
This commit is contained in:
parent
f0b0c53536
commit
f3b383ce63
@ -83,7 +83,7 @@ export default {
|
||||
// If actions are hidden, just return a message list with them excluded
|
||||
if (this.$store.state.settings.statusMessages === "hidden") {
|
||||
return this.channel.messages.filter(
|
||||
(message) => !constants.condensedTypes.includes(message.type)
|
||||
(message) => !constants.condensedTypes.has(message.type)
|
||||
);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ export default {
|
||||
if (
|
||||
message.self ||
|
||||
message.highlight ||
|
||||
!constants.condensedTypes.includes(message.type)
|
||||
!constants.condensedTypes.has(message.type)
|
||||
) {
|
||||
lastCondensedContainer = null;
|
||||
|
||||
|
@ -19,8 +19,7 @@ const colorCodeMap = [
|
||||
["15", "Light Grey"],
|
||||
];
|
||||
|
||||
const condensedTypes = ["chghost", "join", "part", "quit", "nick", "kick", "mode"];
|
||||
const condensedTypesQuery = "." + condensedTypes.join(", .");
|
||||
const condensedTypes = new Set(["chghost", "join", "part", "quit", "nick", "kick", "mode"]);
|
||||
|
||||
const timeFormats = {
|
||||
msgDefault: "HH:mm",
|
||||
@ -33,7 +32,6 @@ export default {
|
||||
colorCodeMap,
|
||||
commands: [],
|
||||
condensedTypes,
|
||||
condensedTypesQuery,
|
||||
timeFormats,
|
||||
sizeUnits,
|
||||
// Same value as media query in CSS that forces sidebars to become overlays
|
||||
|
@ -23,7 +23,7 @@ describe("client-side constants", function() {
|
||||
|
||||
describe(".condensedTypes", function() {
|
||||
it("should be a non-empty array", function() {
|
||||
expect(constants.condensedTypes).to.be.an("array").that.is.not.empty;
|
||||
expect(constants.condensedTypes).to.be.an.instanceof(Set).that.is.not.empty;
|
||||
});
|
||||
|
||||
it("should only contain ASCII strings", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user