ommit
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
This commit is contained in:
1 parent
cbb750a413
commit
497b9a2fc5
42 files changed
+945
-354
No files matched your search
+4
-18
@@ -4,18 +4,14 @@ import React, { useEffect } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
// Import the generated route tree
|
||||
import { routeTree } from "./routeTree.gen";
|
||||
import {
|
||||
ApiProvider,
|
||||
initializeApi,
|
||||
useApiInContext,
|
||||
} from "./utils/store/api";
|
||||
import { CentralProvider, useCentralStore } from "./utils/store/central";
|
||||
import {
|
||||
clearPersistedQueryCache,
|
||||
persistQueryCache,
|
||||
restoreQueryCache,
|
||||
} from "./utils/queryCachePersistence";
|
||||
import { delUser } from "./utils/storage/user";
|
||||
import { ApiProvider, initializeApi, useApiInContext } from "./utils/store/api";
|
||||
import { CentralProvider, useCentralStore } from "./utils/store/central";
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
@@ -55,9 +51,7 @@ const router = createRouter({
|
||||
// search field) must not trigger a transition on every keystroke.
|
||||
defaultViewTransition: {
|
||||
types: ({ pathChanged }) =>
|
||||
pathChanged && document.visibilityState === "visible"
|
||||
? ["page"]
|
||||
: false,
|
||||
pathChanged && document.visibilityState === "visible" ? ["page"] : false,
|
||||
},
|
||||
scrollRestoration: true,
|
||||
scrollRestorationBehavior: "auto",
|
||||
@@ -101,12 +95,6 @@ function ProviderWrapper() {
|
||||
});
|
||||
}, [api?.accessToken, fetchCurrentUser, createApi]);
|
||||
useEffect(() => {
|
||||
if (api) {
|
||||
console.log(`API is set - Route ${window.location.pathname}`);
|
||||
console.log(api);
|
||||
} else {
|
||||
console.log(`API is not set - Route ${window.location.pathname}`);
|
||||
}
|
||||
router.invalidate(); // This is a hack to force the router to re-evaluate the routes and re-run the beforeLoad functions
|
||||
}, [api?.accessToken]);
|
||||
return (
|
||||
@@ -177,9 +165,7 @@ const init = async () => {
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<CentralProvider
|
||||
initialUser={
|
||||
initialUser
|
||||
? { Id: initialUser.Id, Name: initialUser.Name }
|
||||
: null
|
||||
initialUser ? { Id: initialUser.Id, Name: initialUser.Name } : null
|
||||
}
|
||||
>
|
||||
<ApiProvider initialApi={initialApi}>
|
||||
|
||||
Reference in new issue
Block a user