perf: attribute

This commit is contained in:
archer
2023-07-08 10:37:25 +08:00
parent 23642af6e2
commit aef42cef9d
17 changed files with 1177 additions and 351 deletions

View File

@@ -125,7 +125,7 @@ const PcSliderBar = ({
w={'100%'}
h={'100%'}
leftIcon={<AddIcon />}
onClick={() => router.replace(`/chat?modelId=${modelId}`)}
onClick={() => router.replace(`/chat?appId=${modelId}`)}
>
</Button>
@@ -176,9 +176,9 @@ const PcSliderBar = ({
onClick={() => {
if (item._id === chatId) return;
if (isPc) {
router.replace(`/chat?modelId=${item.modelId}&chatId=${item._id}`);
router.replace(`/chat?appId=${item.modelId}&chatId=${item._id}`);
} else {
router.push(`/chat?modelId=${item.modelId}&chatId=${item._id}`);
router.push(`/chat?appId=${item.modelId}&chatId=${item._id}`);
}
}}
onContextMenu={(e) => onclickContextMenu(e, item)}
@@ -251,7 +251,7 @@ const PcSliderBar = ({
try {
await onclickDelHistory(contextMenuData.history._id);
if (contextMenuData.history._id === chatId) {
router.replace(`/chat?modelId=${modelId}`);
router.replace(`/chat?appId=${modelId}`);
}
} catch (error) {
console.log(error);

View File

@@ -30,7 +30,7 @@ const ModelList = ({ models, modelId }: { models: AppListItemType[]; modelId: st
}
: {})}
onClick={() => {
router.replace(`/chat?modelId=${item._id}`);
router.replace(`/chat?appId=${item._id}`);
}}
>
<Avatar src={item.avatar} w={'34px'} h={'34px'} />

View File

@@ -95,7 +95,7 @@ const PhoneSliderBar = ({
color={'white'}
leftIcon={<AddIcon />}
onClick={() => {
router.replace(`/chat?modelId=${modelId}`);
router.replace(`/chat?appId=${modelId}`);
onClose();
}}
>
@@ -128,7 +128,7 @@ const PhoneSliderBar = ({
: {})}
onClick={async () => {
if (item._id === modelId) return;
router.replace(`/chat?modelId=${item._id}`);
router.replace(`/chat?appId=${item._id}`);
onClose();
}}
>
@@ -159,7 +159,7 @@ const PhoneSliderBar = ({
: {})}
onClick={() => {
if (item._id === chatId) return;
router.replace(`/chat?modelId=${item.modelId}&chatId=${item._id}`);
router.replace(`/chat?appId=${item.modelId}&chatId=${item._id}`);
onClose();
}}
>
@@ -177,7 +177,7 @@ const PhoneSliderBar = ({
await delChatHistoryById(item._id);
loadHistory({ pageNum: 1, init: true });
if (item._id === chatId) {
router.replace(`/chat?modelId=${modelId}`);
router.replace(`/chat?appId=${modelId}`);
}
}}
/>