mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
chore(core): add feature flag for ios AI button (#10150)
close AF-2209, AF-2104
This commit is contained in:
@@ -86,6 +86,9 @@ const DetailPageImpl = () => {
|
||||
featureFlagService.flags.enable_mobile_keyboard_toolbar.value;
|
||||
const enableEdgelessEditing =
|
||||
featureFlagService.flags.enable_mobile_edgeless_editing.value;
|
||||
const enableAIButton = useLiveData(
|
||||
featureFlagService.flags.enable_ios_ai_button.$
|
||||
);
|
||||
|
||||
// TODO(@eyhn): remove jotai here
|
||||
const [_, setActiveBlockSuiteEditor] = useActiveBlocksuiteEditor();
|
||||
@@ -113,12 +116,13 @@ const DetailPageImpl = () => {
|
||||
}, [doc, globalContext, mode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!enableAIButton) return;
|
||||
aIButtonService.presentAIButton(true);
|
||||
|
||||
return () => {
|
||||
aIButtonService.presentAIButton(false);
|
||||
};
|
||||
}, [aIButtonService]);
|
||||
}, [aIButtonService, enableAIButton]);
|
||||
|
||||
useEffect(() => {
|
||||
globalContext.isTrashDoc.set(!!isInTrash);
|
||||
|
||||
@@ -260,6 +260,13 @@ export const AFFINE_FLAGS = {
|
||||
configurable: isCanaryBuild,
|
||||
defaultState: false,
|
||||
},
|
||||
enable_ios_ai_button: {
|
||||
category: 'affine',
|
||||
displayName: 'Enable AI Button',
|
||||
description: 'Enable AI Button on iOS',
|
||||
configurable: BUILD_CONFIG.isIOS,
|
||||
defaultState: false,
|
||||
},
|
||||
} satisfies { [key in string]: FlagInfo };
|
||||
|
||||
// oxlint-disable-next-line no-redeclare
|
||||
|
||||
Reference in New Issue
Block a user