File tree 3 files changed +5
-18
lines changed 3 files changed +5
-18
lines changed Original file line number Diff line number Diff line change 17
17
< meta property ="og:type " content ="website " />
18
18
< meta property ="csrf-token " content ="{{ .CSRF.Token }} " />
19
19
< meta property ="build-info " content ="{{ .BuildInfo }} " />
20
- < meta property ="user " content ="{{ .User }} " />
21
20
< meta property ="entitlements " content ="{{ .Entitlements }} " />
22
21
< meta property ="appearance " content ="{{ .Appearance }} " />
23
22
< meta property ="experiments " content ="{{ .Experiments }} " />
Original file line number Diff line number Diff line change @@ -5,10 +5,8 @@ import {
5
5
GetUsersResponse ,
6
6
UpdateUserPasswordRequest ,
7
7
UpdateUserProfileRequest ,
8
- User ,
9
8
UsersRequest ,
10
9
} from "api/typesGenerated" ;
11
- import { getMetadataAsJSON } from "utils/metadata" ;
12
10
import { getAuthorizationKey } from "./authCheck" ;
13
11
14
12
export const users = ( req : UsersRequest ) : UseQueryOptions < GetUsersResponse > => {
@@ -89,21 +87,11 @@ export const authMethods = () => {
89
87
} ;
90
88
} ;
91
89
92
- const initialMeData = getMetadataAsJSON < User > ( "user" ) ;
93
- const meKey = [ "me" ] as const ;
94
-
95
- export const me = ( queryClient : QueryClient ) => {
90
+ export const me = ( ) => {
96
91
return {
97
- queryKey : meKey ,
98
- queryFn : async ( ) => {
99
- const cachedData = queryClient . getQueryData ( meKey ) ;
100
- if ( cachedData === undefined && initialMeData !== undefined ) {
101
- return initialMeData ;
102
- }
103
-
104
- return API . getAuthenticatedUser ( ) ;
105
- } ,
106
- } satisfies UseQueryOptions < User > ;
92
+ queryKey : [ "me" ] ,
93
+ queryFn : async ( ) => API . getAuthenticatedUser ( ) ,
94
+ } ;
107
95
} ;
108
96
109
97
export const hasFirstUser = ( ) => {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const AuthContext = createContext<AuthContextValue | undefined>(undefined);
46
46
47
47
export const AuthProvider : FC < PropsWithChildren > = ( { children } ) => {
48
48
const queryClient = useQueryClient ( ) ;
49
- const meOptions = me ( queryClient ) ;
49
+ const meOptions = me ( ) ;
50
50
51
51
const userQuery = useQuery ( meOptions ) ;
52
52
const authMethodsQuery = useQuery ( authMethods ( ) ) ;
You can’t perform that action at this time.
0 commit comments