chore: updates
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { isNull, omitBy } from "lodash";
|
||||
import { omitBy } from "lodash";
|
||||
|
||||
import { Channel, UpdateChannelDTO, UpdatePinnedMessageDTO } from "@/types/channel";
|
||||
import BASE_URL from "../config";
|
||||
import { isUndefinedOrNull } from "@udecode/plate-common";
|
||||
|
||||
// import { updateVoicingInfo } from "./voice";
|
||||
|
||||
@@ -74,8 +75,13 @@ const channelsSlice = createSlice({
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// old code: state.byId[gid] = { ...state.byId[gid]!, ...getNonNullValues(rest) };
|
||||
state.byId[gid] = { ...state.byId[gid]!, ...omitBy(rest, isNull) };
|
||||
{
|
||||
const wtf = omitBy(rest, isUndefinedOrNull);
|
||||
console.log("rrrr", wtf);
|
||||
|
||||
// old code: state.byId[gid] = { ...state.byId[gid]!, ...getNonNullValues(rest) };
|
||||
state.byId[gid] = { ...state.byId[gid]!, ...wtf };
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -146,13 +146,9 @@ const Send: FC<IProps> = ({
|
||||
const onlyOwnerCanSend = !!(context == "channel"
|
||||
? channelsData[id]?.only_owner_can_send_msg
|
||||
: false);
|
||||
const canSendMessageInChannel = !isChannelOwner && onlyOwnerCanSend;
|
||||
if (canSendMessageInChannel) {
|
||||
return (
|
||||
<div className="p-5 uppercase bg-gray-200 rounded-lg w-fit dark:bg-gray-600 text-red-300">
|
||||
only Channel owner can send message!
|
||||
</div>
|
||||
);
|
||||
const canNotSendMessageInChannel = !isChannelOwner && onlyOwnerCanSend;
|
||||
if (canNotSendMessageInChannel) {
|
||||
return null;
|
||||
}
|
||||
if (context == "dm" && blocked) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user