Skip to content

Commit 5bad3cc

Browse files
fix(profile): use authState for copilot query
1 parent bb0a8c3 commit 5bad3cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pages/profile.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Button, ButtonGroup, Card } from '@blueprintjs/core'
22

3+
import { useAtom } from 'jotai'
34
import { ComponentType, useState } from 'react'
45
import { Navigate, useParams } from 'react-router-dom'
56

67
import { OperationList } from 'components/OperationList'
78
import { OperationSetList } from 'components/OperationSetList'
89
import { OperationDrawer } from 'components/drawer/OperationDrawer'
10+
import { authAtom } from 'store/auth'
911

1012
import { useUserInfo } from '../apis/user'
1113
import { CardTitle } from '../components/CardTitle'
@@ -21,6 +23,8 @@ const _ProfilePage: ComponentType = () => {
2123

2224
const { data: userInfo } = useUserInfo({ userId: id, suspense: true })
2325

26+
const [authState, _setAuthState] = useAtom(authAtom)
27+
2428
const [listMode, setListMode] = useState<'operation' | 'operationSet'>(
2529
'operation',
2630
)
@@ -54,7 +58,7 @@ const _ProfilePage: ComponentType = () => {
5458
<OperationList
5559
limit={10}
5660
orderBy="id"
57-
uploaderId={id}
61+
uploaderId={authState.userId == id ? 'me' : id}
5862
onUpdate={({ total }) => setOperationCount(total)}
5963
/>
6064
)}

0 commit comments

Comments
 (0)