Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg: channel block switch ff (#2074)

teo467e17c9da11
diff --git a/js/app/packages/block-channel/component/ChannelBlockSwitch.tsx b/js/app/packages/block-channel/component/ChannelBlockSwitch.tsx
new file mode 100644
index 0000000000..f5e318c383
--- /dev/null
+++ b/js/app/packages/block-channel/component/ChannelBlockSwitch.tsx
@@ -0,0 +1,15 @@
+import { ShowFeatureFlag } from '@app/lib/analytics/posthog';
+import type { BlockChannelProps } from './Block';
+import BlockChannel from './Block';
+import { NewChannelBlockAdapter } from './NewChannelBlockAdapter';
+
+export function ChannelBlockSwitch(props: BlockChannelProps) {
+ return (
+ <ShowFeatureFlag
+ key="enable-new-channels"
+ fallback={<BlockChannel {...props} />}
+ >
+ <NewChannelBlockAdapter />
+ </ShowFeatureFlag>
+ );
+}
diff --git a/js/app/packages/block-channel/definition.ts b/js/app/packages/block-channel/definition.ts
index 208f24a601..2f4f589d3c 100644
--- a/js/app/packages/block-channel/definition.ts
+++ b/js/app/packages/block-channel/definition.ts
@@ -1,14 +1,13 @@
import { defineBlock, type ExtractLoadType, LoadErrors } from '@core/block';
import { ok } from '@core/util/maybeResult';
-import ChannelBlock from './component/Block';
import { fetchAndCacheChannel } from '@queries/channel/channel';
import { ENABLE_NEW_CHANNELS } from '@core/constant/featureFlags';
-import { NewChannelBlockAdapter } from './component/NewChannelBlockAdapter';
+import { ChannelBlockSwitch } from './component/ChannelBlockSwitch';
export const definition = defineBlock({
name: 'channel',
description: '',
- component: ENABLE_NEW_CHANNELS() ? NewChannelBlockAdapter : ChannelBlock,
+ component: ChannelBlockSwitch,
liveTrackingEnabled: true,
async load(source, _intent) {
if (source.type === 'dss') {