mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 19:02:23 +08:00
feat(editor): add feature flag service (#9592)
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
EMBED_CARD_HEIGHT,
|
||||
EMBED_CARD_WIDTH,
|
||||
} from '@blocksuite/affine-shared/consts';
|
||||
import { FeatureFlagService } from '@blocksuite/affine-shared/services';
|
||||
import { cloneReferenceInfoWithoutAliases } from '@blocksuite/affine-shared/utils';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
|
||||
@@ -15,10 +16,10 @@ export class EmbedEdgelessLinkedDocBlockComponent extends toEdgelessEmbedBlock(
|
||||
override convertToEmbed = () => {
|
||||
const { id, doc, caption, xywh } = this.model;
|
||||
|
||||
// synced doc entry controlled by awareness flag
|
||||
const isSyncedDocEnabled = doc.awarenessStore.getFlag(
|
||||
'enable_synced_doc_block'
|
||||
);
|
||||
// synced doc entry controlled by flag
|
||||
const isSyncedDocEnabled = doc
|
||||
.get(FeatureFlagService)
|
||||
.getFlag('enable_synced_doc_block');
|
||||
if (!isSyncedDocEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import {
|
||||
DocDisplayMetaProvider,
|
||||
DocModeProvider,
|
||||
FeatureFlagService,
|
||||
ThemeProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
@@ -129,10 +130,10 @@ export class EmbedLinkedDocBlockComponent extends EmbedBlockComponent<EmbedLinke
|
||||
|
||||
const { doc, caption } = this.model;
|
||||
|
||||
// synced doc entry controlled by awareness flag
|
||||
const isSyncedDocEnabled = doc.awarenessStore.getFlag(
|
||||
'enable_synced_doc_block'
|
||||
);
|
||||
// synced doc entry controlled by flag
|
||||
const isSyncedDocEnabled = doc
|
||||
.get(FeatureFlagService)
|
||||
.getFlag('enable_synced_doc_block');
|
||||
if (!isSyncedDocEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user