mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
feat: add feature flag for peek view (#7122)
This commit is contained in:
@@ -86,7 +86,7 @@ const usePatchSpecs = (page: Doc, specs: BlockSpec[]) => {
|
||||
patchReferenceRenderer(patched, reactToLit, referenceRenderer),
|
||||
confirmModal
|
||||
);
|
||||
if (!page.readonly) {
|
||||
if (!page.readonly && runtimeConfig.enablePeekView) {
|
||||
patched = patchPeekViewService(patched, peekViewService);
|
||||
}
|
||||
return patched;
|
||||
|
||||
@@ -124,13 +124,18 @@ export class PeekViewEntity extends Entity {
|
||||
.map(show => show && this._active$.value !== null)
|
||||
.distinctUntilChanged();
|
||||
|
||||
// return true if the peek view will be handled
|
||||
open = (target: ActivePeekView['target']) => {
|
||||
if (!runtimeConfig.enablePeekView) {
|
||||
return false;
|
||||
}
|
||||
const resolvedInfo = resolvePeekInfoFromPeekTarget(target);
|
||||
if (!resolvedInfo) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
this._active$.next({ target, info: resolvedInfo });
|
||||
this._show$.next(true);
|
||||
return true;
|
||||
};
|
||||
|
||||
close = () => {
|
||||
|
||||
@@ -219,7 +219,7 @@ export function CurrentWorkspaceModals() {
|
||||
<CloudQuotaModal />
|
||||
)}
|
||||
<AiLoginRequiredModal />
|
||||
<PeekViewManagerModal />
|
||||
{runtimeConfig.enablePeekView && <PeekViewManagerModal />}
|
||||
{environment.isDesktop && <FindInPageModal />}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user