Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
628bfb4f
Commit
628bfb4f
authored
Dec 20, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more debug
parent
117f9c9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
useFetch.tsx
lib/hooks/useFetch.tsx
+2
-3
_app.tsx
pages/_app.tsx
+21
-0
No files found.
lib/hooks/useFetch.tsx
View file @
628bfb4f
...
...
@@ -27,7 +27,8 @@ export default function useFetch() {
};
return
fetch
(
path
,
reqParams
).
then
(
response
=>
{
// eslint-disable-next-line no-debugger
debugger
;
if
(
!
response
.
ok
)
{
const
error
=
{
status
:
response
.
status
,
...
...
@@ -49,8 +50,6 @@ export default function useFetch() {
);
}
else
{
// eslint-disable-next-line no-debugger
debugger
;
if
(
path
.
includes
(
RESOURCES
.
csrf
.
path
))
{
return
Promise
.
resolve
({
token
:
response
.
headers
.
get
(
'
x-bs-account-csrf
'
)
})
as
unknown
as
Promise
<
Success
>
;
}
...
...
pages/_app.tsx
View file @
628bfb4f
...
...
@@ -15,6 +15,14 @@ import theme from 'theme';
import
AppError
from
'
ui/shared/AppError/AppError
'
;
import
ErrorBoundary
from
'
ui/shared/ErrorBoundary
'
;
const
ReactQueryDevtoolsProduction
=
React
.
lazy
(()
=>
import
(
'
@tanstack/react-query-devtools/build/lib/index.prod.js
'
).
then
(
(
d
)
=>
({
'
default
'
:
d
.
ReactQueryDevtools
,
}),
),
);
function
MyApp
({
Component
,
pageProps
}:
AppProps
)
{
useConfigSentry
();
const
[
queryClient
]
=
useState
(()
=>
new
QueryClient
({
...
...
@@ -54,6 +62,14 @@ function MyApp({ Component, pageProps }: AppProps) {
Sentry
.
captureException
(
error
);
},
[]);
const
[
showDevtools
,
setShowDevtools
]
=
React
.
useState
(
false
);
React
.
useEffect
(()
=>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window
.
toggleDevtools
=
()
=>
setShowDevtools
((
old
)
=>
!
old
);
},
[]);
return
(
<
Chakra
theme=
{
theme
}
cookies=
{
pageProps
.
cookies
}
>
<
ErrorBoundary
renderErrorScreen=
{
renderErrorScreen
}
onError=
{
handleError
}
>
...
...
@@ -65,6 +81,11 @@ function MyApp({ Component, pageProps }: AppProps) {
</
SocketProvider
>
</
ScrollDirectionProvider
>
<
ReactQueryDevtools
/>
{
showDevtools
&&
(
<
React
.
Suspense
fallback=
{
null
}
>
<
ReactQueryDevtoolsProduction
/>
</
React
.
Suspense
>
)
}
</
QueryClientProvider
>
</
AppContextProvider
>
</
ErrorBoundary
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment