chore: updates

This commit is contained in:
Tristan Yang
2023-01-29 09:28:11 +08:00
parent 46113159d2
commit 0abf149188
8 changed files with 43 additions and 67 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
if (!mids || mids.length == 0) {
return { key: `channel_${id}`, unreads: 0, id, type: "channel" };
}
const mid = [...mids].pop();
const mid = [...mids].sort().pop();
return { key: `channel_${id}`, id, mid, type: "channel" };
});
const uSessions = DMs.map((id) => {
@@ -46,7 +46,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
if (!mids || mids.length == 0) {
return { key: `user_${id}`, unreads: 0, id, type: "user" };
}
const mid = [...mids].pop();
const mid = [...mids].sort().pop();
return { key: `user_${id}`, type: "user", id, mid };
});
const tmps = [...(cSessions as ChatSession[]), ...(uSessions as ChatSession[])].sort((a, b) => {