refactor: unify chat context type

This commit is contained in:
Tristan Yang
2023-05-15 13:26:55 +08:00
parent c6edf3e8b1
commit 110b0891ad
30 changed files with 79 additions and 51 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ import { updateSelectMessages } from "../../app/slices/ui";
import { useAppSelector } from "../../app/store";
import LinkifyText from "../../common/component/LinkifyText";
import i18n from "../../i18n";
import { ChatContext } from "../../types/common";
export function getUnreadCount({
mids = [],
@@ -122,7 +123,7 @@ type Params = {
prev?: object | null;
curr: object | null;
contextId: number;
context: "user" | "channel";
context: ChatContext;
};
export const renderMessageFragment = ({
readonly = false,
@@ -132,7 +133,7 @@ export const renderMessageFragment = ({
prev,
curr = null,
contextId = 0,
context = "user"
context = "dm"
}: Params) => {
if (!curr) return <div className="w-full h-[1px] invisible"></div>;
let { created_at, mid } = curr;