mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
chore: remove multiple cloud server flag (#12531)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The "Add Selfhosted" and "Add Server" options are now displayed whenever the build configuration is native, without relying on feature flags. - **Refactor** - Simplified conditional rendering for server addition buttons by replacing feature flag checks with build configuration checks. - **Chores** - Removed the "Multiple Cloud Servers" feature flag and its related localization strings, streamlining feature management and UI labels. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -10,7 +10,6 @@ import { OAuth } from '@affine/core/components/affine/auth/oauth';
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { AuthService, ServerService } from '@affine/core/modules/cloud';
|
||||
import type { AuthSessionStatus } from '@affine/core/modules/cloud/entities/session';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import { ServerDeploymentType } from '@affine/graphql';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import {
|
||||
@@ -61,10 +60,6 @@ export const SignInStep = ({
|
||||
)
|
||||
);
|
||||
const authService = useService(AuthService);
|
||||
const featureFlagService = useService(FeatureFlagService);
|
||||
const enableMultipleCloudServers = useLiveData(
|
||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
||||
);
|
||||
const [isMutating, setIsMutating] = useState(false);
|
||||
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -181,7 +176,7 @@ export const SignInStep = ({
|
||||
<div className={style.skipDividerLine} />
|
||||
</div>
|
||||
<div className={style.skipSection}>
|
||||
{BUILD_CONFIG.isElectron && enableMultipleCloudServers ? (
|
||||
{BUILD_CONFIG.isNative ? (
|
||||
<Button
|
||||
variant="plain"
|
||||
className={style.addSelfhostedButton}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Divider, MenuItem } from '@affine/component';
|
||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { PlusIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import {
|
||||
@@ -16,18 +15,15 @@ import { addServerDividerWrapper } from './index.css';
|
||||
export const AddServer = () => {
|
||||
const t = useI18n();
|
||||
const globalDialogService = useService(GlobalDialogService);
|
||||
const featureFlagService = useService(FeatureFlagService);
|
||||
const enableMultipleServer = useLiveData(
|
||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
||||
);
|
||||
|
||||
const onAddServer = useCallback(() => {
|
||||
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
||||
}, [globalDialogService]);
|
||||
|
||||
if (!enableMultipleServer) {
|
||||
if (!BUILD_CONFIG.isNative) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={addServerDividerWrapper}>
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
ServersService,
|
||||
} from '@affine/core/modules/cloud';
|
||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import { GlobalContextService } from '@affine/core/modules/global-context';
|
||||
import {
|
||||
type WorkspaceMetadata,
|
||||
@@ -262,18 +261,15 @@ const CloudWorkSpaceList = ({
|
||||
|
||||
const AddServer = () => {
|
||||
const globalDialogService = useService(GlobalDialogService);
|
||||
const featureFlagService = useService(FeatureFlagService);
|
||||
const enableMultipleServer = useLiveData(
|
||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
||||
);
|
||||
|
||||
const onAddServer = useCallback(() => {
|
||||
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
||||
}, [globalDialogService]);
|
||||
|
||||
if (!enableMultipleServer) {
|
||||
if (!BUILD_CONFIG.isNative) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <IconButton onClick={onAddServer} size="24" icon={<SelfhostIcon />} />;
|
||||
};
|
||||
|
||||
|
||||
@@ -209,15 +209,6 @@ export const AFFINE_FLAGS = {
|
||||
configurable: false,
|
||||
defaultState: isMobile,
|
||||
},
|
||||
enable_multiple_cloud_servers: {
|
||||
category: 'affine',
|
||||
displayName:
|
||||
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name',
|
||||
description:
|
||||
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description',
|
||||
configurable: false,
|
||||
defaultState: isDesktopEnvironment || BUILD_CONFIG.isIOS,
|
||||
},
|
||||
enable_mobile_edgeless_editing: {
|
||||
category: 'affine',
|
||||
displayName:
|
||||
|
||||
Reference in New Issue
Block a user