Skip to content

Commit

Permalink
fix(core): do not redirect to open-page for open-in-app card (#8646)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Oct 31, 2024
1 parent 2b3b705 commit 51ffccb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Checkbox } from '@affine/component';
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';
import {
OpenInAppService,
OpenLinkMode,
Expand All @@ -16,17 +15,16 @@ import * as styles from './open-in-app-card.css';
export const OpenInAppCard = ({ className }: { className?: string }) => {
const openInAppService = useService(OpenInAppService);
const show = useLiveData(openInAppService.showOpenInAppBanner$);
const navigateHelper = useNavigateHelper();
const t = useI18n();

const [remember, setRemember] = useState(false);

const onOpen = useCallback(() => {
navigateHelper.jumpToOpenInApp(window.location.href, true);
openInAppService.showOpenInAppPage();
if (remember) {
openInAppService.setOpenLinkMode(OpenLinkMode.OPEN_IN_DESKTOP_APP);
}
}, [openInAppService, remember, navigateHelper]);
}, [openInAppService, remember]);

const onDismiss = useCallback(() => {
openInAppService.dismissBanner(
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/src/modules/desktop-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
WorkspaceScope,
} from '@toeverything/infra';

import { WorkbenchService } from '../workbench';
import { WorkbenchService } from '../workbench/services/workbench';
import { DesktopApi } from './entities/electron-api';
import { ElectronApiImpl } from './impl';
import { DesktopApiProvider } from './provider';
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/src/modules/navigation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { NavigationButtons } from './view/navigation-buttons';

import { type Framework, WorkspaceScope } from '@toeverything/infra';

import { WorkbenchService } from '../workbench';
import { WorkbenchService } from '../workbench/services/workbench';
import { Navigator } from './entities/navigator';
import { NavigatorService } from './services/navigator';

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/src/modules/userspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export { UserspaceService as UserDBService } from './services/userspace';
import type { Framework } from '@toeverything/infra';

import { AuthService, WebSocketService } from '../cloud';
import { DesktopApiService } from '../desktop-api';
import { DesktopApiService } from '../desktop-api/service/desktop-api';
import { CurrentUserDB } from './entities/current-user-db';
import { UserDB } from './entities/user-db';
import { UserDBEngine } from './entities/user-db-engine';
Expand Down

0 comments on commit 51ffccb

Please sign in to comment.