Skip to content

Commit

Permalink
fix(core): wrong app scheme fallback (#8914)
Browse files Browse the repository at this point in the history
  • Loading branch information
forehalo authored Nov 25, 2024
1 parent 7c846c4 commit 0a20332
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/frontend/core/src/desktop/pages/open-app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenInAppPage } from '@affine/core/modules/open-in-app/views/open-in-app-page';
import { appSchemes } from '@affine/core/utils/channel';
import { appSchemes, channelToScheme } from '@affine/core/utils/channel';
import type { GetCurrentUserQuery } from '@affine/graphql';
import { fetcher, getCurrentUserQuery } from '@affine/graphql';
import type { LoaderFunction } from 'react-router-dom';
Expand Down Expand Up @@ -37,7 +37,9 @@ const OpenOAuthJwt = () => {
const [params] = useSearchParams();

const maybeScheme = appSchemes.safeParse(params.get('scheme'));
const scheme = maybeScheme.success ? maybeScheme.data : 'affine';
const scheme = maybeScheme.success
? maybeScheme.data
: channelToScheme[BUILD_CONFIG.appBuildType];
const next = params.get('next');

if (!currentUser || !currentUser?.token?.sessionToken) {
Expand Down

0 comments on commit 0a20332

Please sign in to comment.