File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Classes as Popover2Classes } from '@blueprintjs/popover2'
4
4
import clsx from 'clsx'
5
5
import { useAtomValue } from 'jotai'
6
6
import { MaaUserInfo } from 'maa-copilot-client'
7
- import { FC } from 'react'
7
+ import { FC , useEffect } from 'react'
8
8
9
9
import { useUserSearch } from '../apis/user'
10
10
import { authAtom } from '../store/auth'
@@ -43,6 +43,13 @@ export const UserFilter: FC<UserFilterProps> = ({
43
43
isValidating,
44
44
} = useUserSearch ( { keyword : debouncedQuery } )
45
45
46
+ useEffect ( ( ) => {
47
+ // 退出登录时清空 myself
48
+ if ( isMyself ( user ) && ! auth . token ) {
49
+ onChange ( undefined )
50
+ }
51
+ } , [ auth . token , user , onChange ] )
52
+
46
53
return (
47
54
< Select < MaaUserInfo >
48
55
className = { clsx ( 'items-stretch' , className ) }
You can’t perform that action at this time.
0 commit comments