feat: updates

This commit is contained in:
qier222 2022-04-16 21:14:03 +08:00
parent fc1c25f404
commit 7b6579e068
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
48 changed files with 1155 additions and 777 deletions

View file

@ -1,13 +1,14 @@
import { fetchUserAccount, fetchUserAccountResponse } from '@/renderer/api/user'
import { UserApiNames } from '@/renderer/api/user'
import { IpcChannels } from '@/main/IpcChannelsName'
import { fetchUserAccount } from '@/renderer/api/user'
import { UserApiNames, FetchUserAccountResponse } from '@/shared/api/User'
import { APIs } from '@/shared/CacheAPIs'
import { IpcChannels } from '@/shared/IpcChannels'
export default function useUser() {
return useQuery(UserApiNames.FETCH_USER_ACCOUNT, fetchUserAccount, {
refetchOnWindowFocus: true,
placeholderData: (): fetchUserAccountResponse | undefined =>
placeholderData: (): FetchUserAccountResponse | undefined =>
window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
api: 'user/account',
api: APIs.UserAccount,
}),
})
}