fix: skip Tauri updater in Electron, add debug logging for routing
This commit is contained in:
@@ -73,6 +73,13 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
const { hashRouter } = clientConfig;
|
||||
const mobile = screenSize === ScreenSize.Mobile;
|
||||
|
||||
console.log('[Router] Creating router:', {
|
||||
hashRouter,
|
||||
hashRouterEnabled: hashRouter?.enabled,
|
||||
baseUrl: import.meta.env.BASE_URL,
|
||||
locationHref: window.location.href,
|
||||
});
|
||||
|
||||
const routes = createRoutesFromElements(
|
||||
<Route>
|
||||
<Route
|
||||
@@ -295,8 +302,10 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
);
|
||||
|
||||
if (hashRouter?.enabled) {
|
||||
console.log('[Router] Using HashRouter with basename:', hashRouter.basename);
|
||||
return createHashRouter(routes, { basename: hashRouter.basename });
|
||||
}
|
||||
console.log('[Router] Using BrowserRouter with basename:', import.meta.env.BASE_URL);
|
||||
return createBrowserRouter(routes, {
|
||||
basename: import.meta.env.BASE_URL,
|
||||
});
|
||||
|
||||
@@ -117,7 +117,14 @@ export const useLoginComplete = (data?: CustomLoginResponse) => {
|
||||
setFallbackSession(loginRes.access_token, loginRes.device_id, loginRes.user_id, loginBaseUrl);
|
||||
const afterLoginRedirectUrl = getAfterLoginRedirectPath();
|
||||
deleteAfterLoginRedirectPath();
|
||||
navigate(afterLoginRedirectUrl ?? getHomePath(), { replace: true });
|
||||
const targetPath = afterLoginRedirectUrl ?? getHomePath();
|
||||
console.log('[Login] Navigating after login:', {
|
||||
targetPath,
|
||||
afterLoginRedirectUrl,
|
||||
homePath: getHomePath(),
|
||||
currentLocation: window.location.href,
|
||||
});
|
||||
navigate(targetPath, { replace: true });
|
||||
}
|
||||
}, [data, navigate]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user