fix: ConversationsList navigate replace

test: 移动端键盘事件
fix: 历史记录: 搜索组件
dev/mobile
Lei OT 2 years ago
parent 1681ca8ab6
commit 4a1b7212ae

@ -36,7 +36,7 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
optionFilterProp='label' optionFilterProp='label'
> >
{options.map((d) => ( {options.map((d) => (
<Select.Option key={`${d.value}${d.label}`} title={d.label}> <Select.Option key={d.value} title={d.label}>
{d.label} {d.label}
</Select.Option> </Select.Option>
))} ))}

@ -11,7 +11,8 @@ import useAuthStore from '@/stores/AuthStore';
* [] * []
*/ */
const Conversations = ({ mobile }) => { const Conversations = ({ mobile }) => {
const routerReplace = mobile === undefined ? false : true; const routerReplace = mobile === undefined ? true : false; // : true;
const routePrefix = mobile === undefined ? `/order/chat` : `/m/chat`;
const { state: orderRow } = useLocation(); const { state: orderRow } = useLocation();
const { coli_guest_WhatsApp } = orderRow || {}; const { coli_guest_WhatsApp } = orderRow || {};
const { order_sn } = useParams(); const { order_sn } = useParams();
@ -80,13 +81,12 @@ const Conversations = ({ mobile }) => {
const onSwitchConversation = async (item) => { const onSwitchConversation = async (item) => {
setCurrentConversation(item); setCurrentConversation(item);
const routePrefix = mobile === undefined ? `/order/chat` : `/m/chat`;
if (isEmpty(item.coli_sn)) { if (isEmpty(item.coli_sn)) {
navigate(routePrefix, { replace: true }); navigate(routePrefix, { replace: true });
} else { } else {
setSwitchToC(item); setSwitchToC(item);
setShouldFetchCList(false); setShouldFetchCList(false);
navigate(`${routePrefix}/${item.coli_sn}`, { replace: routePrefix }); navigate(`${routePrefix}/${item.coli_sn}`, { replace: routerReplace });
} }
// if (!isEmpty(item.coli_sn)) { // if (!isEmpty(item.coli_sn)) {
// setSwitchToC(item); // setSwitchToC(item);
@ -102,7 +102,7 @@ const Conversations = ({ mobile }) => {
await fetchConversationItemClose({ conversationid: item.sn, opisn: item.opi_sn }); await fetchConversationItemClose({ conversationid: item.sn, opisn: item.opi_sn });
delConversationitem(item); delConversationitem(item);
if (String(order_sn) === String(item.coli_sn)) { if (String(order_sn) === String(item.coli_sn)) {
navigate(`/order/chat`, { replace: routerReplace }); navigate(routePrefix, { replace: routerReplace });
} }
}; };

@ -186,6 +186,7 @@ const InputComposer = ({ mobile }) => {
const focusInput = () => { const focusInput = () => {
textInputRef.current.focus({ cursor: 'end', preventScroll: true }); textInputRef.current.focus({ cursor: 'end', preventScroll: true });
window.dispatchEvent(new Event('resize'));
}; };
const addEmoji = (emoji) => { const addEmoji = (emoji) => {

Loading…
Cancel
Save