mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-03 20:41:49 +03:00
feat(core): try cloud link (#6660)
This commit is contained in:
parent
94de6f5853
commit
d36b5e14aa
@ -77,7 +77,6 @@ export const Component = () => {
|
||||
// check is user logged in && has cloud workspace
|
||||
if (searchParams.get('initCloud') === 'true') {
|
||||
if (loggedIn) {
|
||||
searchParams.delete('initCloud');
|
||||
if (list.every(w => w.flavour !== WorkspaceFlavour.AFFINE_CLOUD)) {
|
||||
createCloudWorkspace();
|
||||
return;
|
||||
|
@ -4,6 +4,7 @@ import type { NavigateFunction, RouteObject } from 'react-router-dom';
|
||||
import {
|
||||
createBrowserRouter as reactRouterCreateBrowserRouter,
|
||||
Outlet,
|
||||
redirect,
|
||||
useLocation,
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
useNavigate,
|
||||
@ -104,6 +105,14 @@ export const topLevelRoutes = [
|
||||
path: '/subscribe',
|
||||
lazy: () => import('./pages/subscribe'),
|
||||
},
|
||||
{
|
||||
path: '/try-cloud',
|
||||
loader: () => {
|
||||
return redirect(
|
||||
`/signIn?redirect_uri=${encodeURIComponent('/?initCloud=true')}`
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
lazy: () => import('./pages/404'),
|
||||
|
Loading…
Reference in New Issue
Block a user