refactor: drop legacy room chatType
This commit is contained in:
@@ -8,13 +8,12 @@ describe("normalizeChatType", () => {
|
||||
expect(normalizeChatType("dm")).toBe("direct");
|
||||
expect(normalizeChatType("group")).toBe("group");
|
||||
expect(normalizeChatType("channel")).toBe("channel");
|
||||
expect(normalizeChatType("room")).toBe("channel");
|
||||
});
|
||||
|
||||
it("returns undefined for empty/unknown values", () => {
|
||||
expect(normalizeChatType(undefined)).toBeUndefined();
|
||||
expect(normalizeChatType("")).toBeUndefined();
|
||||
expect(normalizeChatType("nope")).toBeUndefined();
|
||||
expect(normalizeChatType("room")).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ export function normalizeChatType(raw?: string): NormalizedChatType | undefined
|
||||
if (!value) return undefined;
|
||||
if (value === "direct" || value === "dm") return "direct";
|
||||
if (value === "group") return "group";
|
||||
if (value === "channel" || value === "room") return "channel";
|
||||
if (value === "channel") return "channel";
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user