fix(core): temporarily make AI functions not follow server configuration (#8698)

Since the switch of the AI ​​function in Blocksuite cannot be hot-updated, the editor will not be able to use the AI ​​function when it is not connected to the server at the beginning, so this code is temporarily removed.
This commit is contained in:
JimmFly
2024-11-05 08:17:58 +00:00
parent 9e903fe909
commit aae71a23eb
3 changed files with 6 additions and 41 deletions
@@ -7,7 +7,6 @@ import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-
import { DocPropertySidebar } from '@affine/core/components/doc-properties/sidebar';
import { useAppSettingHelper } from '@affine/core/components/hooks/affine/use-app-setting-helper';
import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta';
import { ServerConfigService } from '@affine/core/modules/cloud';
import { EditorService } from '@affine/core/modules/editor';
import { RecentDocsService } from '@affine/core/modules/quicksearch';
import { ViewService } from '@affine/core/modules/workbench/services/view';
@@ -70,7 +69,6 @@ const DetailPageImpl = memo(function DetailPageImpl() {
workspaceService,
globalContextService,
featureFlagService,
serverConfigService,
} = useServices({
WorkbenchService,
ViewService,
@@ -79,7 +77,6 @@ const DetailPageImpl = memo(function DetailPageImpl() {
WorkspaceService,
GlobalContextService,
FeatureFlagService,
ServerConfigService,
});
const workbench = workbenchService.workbench;
const editor = editorService.editor;
@@ -106,12 +103,7 @@ const DetailPageImpl = memo(function DetailPageImpl() {
const [_, setActiveBlockSuiteEditor] = useActiveBlocksuiteEditor();
const t = useI18n();
const serverFeatures = useLiveData(
serverConfigService.serverConfig.features$
);
const enableAI =
serverFeatures?.copilot && featureFlagService.flags.enable_ai.value;
const enableAI = featureFlagService.flags.enable_ai.value;
useEffect(() => {
if (isActiveView) {