fix: pin message highlight error

This commit is contained in:
zerosoul
2022-05-27 16:48:20 +08:00
parent 4f542eccf2
commit e11734e84c
+3 -2
View File
@@ -26,8 +26,9 @@ export default function usePinMessage(cid = null) {
unpin({ mid, gid: +cid });
};
const getPinInfo = (mid) => {
const pins = channel?.pinned_messages;
if (pins?.length == 0) return;
if (!cid || !channel) return;
const pins = channel.pinned_messages;
if (!pins || pins.length == 0) return;
const pinned = pins.find((p) => p.mid == mid);
return pinned;
};