fix chat quote reader (#4125)

This commit is contained in:
heheer
2025-03-12 18:09:41 +08:00
committed by archer
parent 19f0f110e2
commit 8bc29e6527
14 changed files with 167 additions and 125 deletions

View File

@@ -90,6 +90,14 @@ const OutLink = (props: Props) => {
const totalRecordsCount = useContextSelector(ChatRecordContext, (v) => v.totalRecordsCount);
const isChatRecordsLoaded = useContextSelector(ChatRecordContext, (v) => v.isChatRecordsLoaded);
const [sidebarFolded, setSidebarFolded] = useState(false);
useEffect(() => {
if (quoteData) {
setSidebarFolded(true);
}
}, [quoteData]);
const initSign = useRef(false);
const { data, loading } = useRequest2(
async () => {
@@ -221,7 +229,9 @@ const OutLink = (props: Props) => {
if (showHistory !== '1') return null;
return isPc ? (
<SideBar externalTrigger={!!quoteData}>{Children}</SideBar>
<SideBar isFolded={sidebarFolded} onFoldChange={setSidebarFolded}>
{Children}
</SideBar>
) : (
<Drawer
isOpen={isOpenSlider}
@@ -236,7 +246,7 @@ const OutLink = (props: Props) => {
</DrawerContent>
</Drawer>
);
}, [isOpenSlider, isPc, onCloseSlider, quoteData, showHistory, t]);
}, [isOpenSlider, isPc, onCloseSlider, showHistory, t, sidebarFolded]);
return (
<>