fix(core): do not redirect to open-page for open-in-app card (#8646)

This commit is contained in:
pengx17 2024-10-31 08:23:51 +00:00
parent 2b3b7057c5
commit 51ffccbbb6
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED
4 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,4 @@
import { Button, Checkbox } from '@affine/component';
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';
import {
OpenInAppService,
OpenLinkMode,
@ -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(

View File

@ -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';

View File

@ -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';

View File

@ -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';