mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
fix(core): do not show open-in-app in mobile web browser (#8694)
This commit is contained in:
@@ -107,7 +107,7 @@ export const AppearanceSettings = () => {
|
||||
{enableThemeEditor ? <ThemeEditorSetting /> : null}
|
||||
</SettingWrapper>
|
||||
|
||||
{BUILD_CONFIG.isWeb ? (
|
||||
{BUILD_CONFIG.isWeb && !environment.isMobile ? (
|
||||
<SettingWrapper title={t['com.affine.setting.appearance.links']()}>
|
||||
<SettingRow
|
||||
name={t['com.affine.setting.appearance.open-in-app']()}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { OpenInAppService } from './services';
|
||||
|
||||
export * from './services';
|
||||
export * from './utils';
|
||||
export * from './views/open-in-app-guard';
|
||||
|
||||
export const configureOpenInApp = (framework: Framework) => {
|
||||
framework.service(OpenInAppService, [GlobalState, WorkspacesService]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { Fragment, useCallback, useEffect } from 'react';
|
||||
|
||||
import { OpenInAppService } from '../services';
|
||||
import { OpenInAppPage } from './open-in-app-page';
|
||||
@@ -8,11 +8,7 @@ import { OpenInAppPage } from './open-in-app-page';
|
||||
/**
|
||||
* Web only guard to open the URL in desktop app for different conditions
|
||||
*/
|
||||
export const WebOpenInAppGuard = ({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) => {
|
||||
const WebOpenInAppGuard = ({ children }: { children: React.ReactNode }) => {
|
||||
assertExists(
|
||||
BUILD_CONFIG.isWeb,
|
||||
'WebOpenInAppGuard should only be used in web'
|
||||
@@ -36,9 +32,13 @@ export const WebOpenInAppGuard = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
return shouldOpenInApp ? (
|
||||
return shouldOpenInApp && !environment.isMobile ? (
|
||||
<OpenInAppPage openHereClicked={onOpenHere} />
|
||||
) : (
|
||||
children
|
||||
);
|
||||
};
|
||||
|
||||
export const OpenInAppGuard = environment.isMobile
|
||||
? Fragment
|
||||
: WebOpenInAppGuard;
|
||||
|
||||
Reference in New Issue
Block a user