-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix all errors and warnings by eslint * Fix import order * Remove obsolete unused code * Fix layout shift on mobile devices * Added accept language for each request header * Remove useless logs
- Loading branch information
1 parent
040888f
commit 878e3e0
Showing
96 changed files
with
1,338 additions
and
1,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ export default { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import ApplicationRouter from '../pages'; | ||
import i18nManager from './system/i18n.manager'; | ||
import { useVisitorId } from '../shared/hooks'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
|
||
void i18nManager.initialize(); | ||
import i18nManager from './system/i18n.manager' | ||
|
||
export const queryClient = new QueryClient(); | ||
import ApplicationRouter from '~/pages' | ||
import { useVisitorId } from '~/shared/hooks' | ||
|
||
void i18nManager.initialize() | ||
|
||
export const queryClient = new QueryClient() | ||
|
||
function App() { | ||
useVisitorId(); | ||
useVisitorId() | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<ApplicationRouter /> | ||
</QueryClientProvider> | ||
); | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './lib/useAuthenticated'; | ||
export * from './lib/useAuthenticated' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { accountService, UserDTO } from '../../../shared/api/account.service'; | ||
import { AxiosError } from 'axios'; | ||
import { useQuery } from '@tanstack/react-query' | ||
import { AxiosError } from 'axios' | ||
|
||
import { accountService, UserDTO } from '~/shared/api/account.service' | ||
|
||
type Return = { | ||
isLoading: boolean; | ||
isAuthenticated: boolean; | ||
isLoading: boolean | ||
isAuthenticated: boolean | ||
|
||
user: UserDTO | null; | ||
}; | ||
user: UserDTO | null | ||
} | ||
|
||
export const useAuthenticated = (): Return => { | ||
const query = useQuery({ | ||
queryKey: ['/protected/me'], | ||
queryFn: accountService.getAccountInfo, | ||
select(data) { | ||
return data.data.details; | ||
return data.data.details | ||
}, | ||
retry(failureCount, error) { | ||
console.log(error); | ||
console.log(error) | ||
|
||
const axiosError = error as AxiosError; | ||
const axiosError = error as AxiosError | ||
|
||
if (axiosError.response?.status === 401) { | ||
return false; | ||
return false | ||
} | ||
|
||
return failureCount < 4; | ||
return failureCount < 4 | ||
}, | ||
}); | ||
}) | ||
|
||
return { | ||
isLoading: query.isLoading, | ||
isAuthenticated: !!query.data?.user.email, | ||
|
||
user: query.data?.user ?? null, | ||
}; | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './lib/useAuthenticateViaPasskeys' |
Oops, something went wrong.