mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-31 13:49:12 +08:00
refactor(editor): remove assertExists (#10615)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { Fragment, useCallback, useEffect } from 'react';
|
||||
|
||||
@@ -9,10 +8,9 @@ import { OpenInAppPage } from './open-in-app-page';
|
||||
* Web only guard to open the URL in desktop app for different conditions
|
||||
*/
|
||||
const WebOpenInAppGuard = ({ children }: { children: React.ReactNode }) => {
|
||||
assertExists(
|
||||
BUILD_CONFIG.isWeb,
|
||||
'WebOpenInAppGuard should only be used in web'
|
||||
);
|
||||
if (BUILD_CONFIG.isWeb === undefined || BUILD_CONFIG.isWeb === null) {
|
||||
throw new Error('WebOpenInAppGuard should only be used in web');
|
||||
}
|
||||
const service = useService(OpenInAppService);
|
||||
const shouldOpenInApp = useLiveData(service.showOpenInAppPage$);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user