|
|
|
@ -21,11 +21,14 @@ function ChatAssign() {
|
|
|
|
|
const [opi, setOpi] = useState({});
|
|
|
|
|
|
|
|
|
|
async function refreshConversationList() {
|
|
|
|
|
const _list = await fetchConversationsSearch({ whatsapp_id: whatsappid });
|
|
|
|
|
const _list = await fetchConversationsSearch({ whatsapp_id: whatsappid })
|
|
|
|
|
if (_list.length > 0) {
|
|
|
|
|
setCurrentConversation(_list[0]);
|
|
|
|
|
setConversationid(String(_list[0].conversationid));
|
|
|
|
|
setOpi({ label: _list[0].opi_name, value: String(_list[0].opi_sn) });
|
|
|
|
|
const unassignI = _list.findIndex((item) => item.opi_sn === 0)
|
|
|
|
|
if (unassignI > -1) {
|
|
|
|
|
setCurrentConversation(_list[unassignI])
|
|
|
|
|
setConversationid(String(_list[unassignI].conversationid))
|
|
|
|
|
setOpi({ label: _list[unassignI].opi_name, value: String(_list[unassignI].opi_sn) })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -39,7 +42,7 @@ function ChatAssign() {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Layout className='h-full chatwindow-wrapper mobilechat-wrapper' style={{ maxHeight: 'calc(100vh - 32px)', height: 'calc(100vh - 32px)', minWidth: '360px' }}>
|
|
|
|
|
<Header className=' px-2 ant-layout-sider-light ant-card h-auto flex flex-col justify-between gap-1 '>
|
|
|
|
|
<Header className=' px-2 ant-layout-sider-light bg-white ant-card h-auto flex flex-col justify-between gap-1 '>
|
|
|
|
|
<InputAssign className={'block py-2'} initialValues={{ conversationid, whatsappid }} {...{ conversationid, opi }} />
|
|
|
|
|
<MessagesHeader />
|
|
|
|
|
</Header>
|
|
|
|
|