chore: updates
This commit is contained in:
@@ -461,6 +461,7 @@ export default function useStreaming() {
|
||||
// 超过1天或者已断线,强制重连
|
||||
if (canReconnect) {
|
||||
// 设置重连状态
|
||||
toast.dismiss();
|
||||
toast.loading("Reconnecting...");
|
||||
dispatch(updateSSEStatus("reconnecting"));
|
||||
if (SSE) {
|
||||
|
||||
@@ -61,7 +61,7 @@ const Session: FC<IProps> = ({ id, mid }) => {
|
||||
<span
|
||||
className={clsx(
|
||||
`flex items-center gap-2 font-semibold text-sm text-gray-500 dark:text-white truncate`,
|
||||
previewMsg.created_at && "max-w-[190px]"
|
||||
previewMsg.created_at ? "max-w-[120px]" : "max-w-[190px]"
|
||||
)}
|
||||
>
|
||||
{name}
|
||||
|
||||
@@ -55,7 +55,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.filter((p) => !!p);
|
||||
.filter((p) => !!p) as ChatSession[];
|
||||
const channelPinIds = pins
|
||||
.map((p) => {
|
||||
if (p.target.gid) {
|
||||
@@ -94,7 +94,16 @@ const SessionList: FC<Props> = ({ tempSession }) => {
|
||||
// console.log("before qqqq", temps);
|
||||
const newSessions = tempSession ? [tempSession, ...temps] : temps;
|
||||
// console.log("qqqq", newSessions);
|
||||
setSessions(newSessions);
|
||||
// 去重
|
||||
setSessions(
|
||||
newSessions.filter((s, idx) => {
|
||||
const { id, type } = s;
|
||||
const index = newSessions.findIndex((s) => {
|
||||
return s.id == id && s.type == type;
|
||||
});
|
||||
return index === idx;
|
||||
})
|
||||
);
|
||||
setPinSessions(pinTmps);
|
||||
}, [
|
||||
channelIDs,
|
||||
|
||||
Reference in New Issue
Block a user