mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-02 14:22:55 +03:00
fix(core): do not redirect to open-page for open-in-app card (#8646)
This commit is contained in:
parent
2b3b7057c5
commit
51ffccbbb6
@ -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(
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user