mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added useMemos to get data hooks
This commit is contained in:
parent
1904153bba
commit
d9feff085a
11 changed files with 49 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
|||
import { useCallback } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { OAuthProvider } from '~/types/auth';
|
||||
import { API } from '~/constants/api';
|
||||
import { apiAttachSocial, apiDropSocial, apiGetSocials, apiLoginWithSocial } from '~/api/auth';
|
||||
|
@ -89,13 +89,15 @@ export const useOAuth = () => {
|
|||
[mutate]
|
||||
);
|
||||
|
||||
const accounts = useMemo(() => data || [], [data]);
|
||||
|
||||
return {
|
||||
openOauthWindow,
|
||||
loginWithSocial,
|
||||
createSocialAccount,
|
||||
attachAccount,
|
||||
dropAccount,
|
||||
accounts: data || [],
|
||||
accounts,
|
||||
isLoading: !data && isLoading,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue