Skip to content

Commit

Permalink
fix: dissable send in manager
Browse files Browse the repository at this point in the history
  • Loading branch information
hi02102002 committed Jun 6, 2024
1 parent d0796b9 commit 130fe14
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 284 deletions.
538 changes: 269 additions & 269 deletions dist-components/index.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist-components/index.es.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist-components/index.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist-components/index.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist-components/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dialogue-chatbox",
"private": false,
"version": "2.0.0",
"version": "2.0.1",
"type": "module",
"main": "./dist-components/index.umd.js",
"module": "./dist-components/index.es.js",
Expand Down
3 changes: 0 additions & 3 deletions src/chatbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const ChatBox = ({ className }: { className?: string }) => {
className={cn(
'select-none w-full h-screen flex flex-col shadow chatbox',
className,
{
'pointer-events-none': isForManager,
},
)}
style={{
width: customStyles?.windowSize.width,
Expand Down
4 changes: 3 additions & 1 deletion src/context/socket.ctx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ export const SocketProvider = ({

const handleSendMessage: TSocketCtx['handleSendMessage'] = useCallback(
({ message, cb, extraData, type }) => {
if (isForManager) return

const trimmedMessage = message.trim()
if (trimmedMessage.length === 0) return

Expand Down Expand Up @@ -229,7 +231,7 @@ export const SocketProvider = ({

cb && cb(newMessage)
},
[_channelId, adminId, isTest, queryClient, userId],
[_channelId, adminId, isForManager, isTest, queryClient, userId],
)

const handleClose = useCallback(() => {
Expand Down

0 comments on commit 130fe14

Please sign in to comment.