diff --git a/src/common/component/Message/PinMessageModal.js b/src/common/component/Message/PinMessageModal.js index c95531f5..d2e4f9cf 100644 --- a/src/common/component/Message/PinMessageModal.js +++ b/src/common/component/Message/PinMessageModal.js @@ -24,7 +24,7 @@ import toast from "react-hot-toast"; export default function PinMessageModal({ closeModal, mid = 0, gid = 0 }) { // const dispatch = useDispatch(); - const { pinMessage, isPining, isSuccess } = usePinMessage(gid); + const { channel, pinMessage, isPining, isSuccess } = usePinMessage(gid); const handlePin = () => { pinMessage(mid); }; @@ -51,7 +51,7 @@ export default function PinMessageModal({ closeModal, mid = 0, gid = 0 }) { } title="Pin It" - description="You sure you want to pin this message to #gerenal?" + description={`Do you want to pin this message to #${channel?.name}`} > diff --git a/src/common/hook/usePinMessage.js b/src/common/hook/usePinMessage.js index 3fe2f23d..e1e88fc6 100644 --- a/src/common/hook/usePinMessage.js +++ b/src/common/hook/usePinMessage.js @@ -32,6 +32,7 @@ export default function usePinMessage(cid = null) { }, [channel]); return { + channel, pins, canPin: loginUser.is_admin || channel?.owner == loginUser.uid, pinMessage,