

























@@ -41,16 +41,6 @@ const COMMON_SINGLE_ACCOUNT_KEYS_TO_MOVE = new Set([
4141"defaultTo",
4242]);
434344-const BUNDLED_SINGLE_ACCOUNT_PROMOTION_FALLBACKS: Record<string, readonly string[]> = {
45-// Some setup/migration paths run before the channel setup surface has been loaded.
46-telegram: ["streaming"],
47-};
48-49-const BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKS: Record<string, readonly string[]> = {
50-// Keep top-level Telegram policy fallback intact when only auth needs seeding.
51-telegram: ["botToken", "tokenFile"],
52-};
53-5444type ChannelSetupPromotionSurface = {
5545singleAccountKeysToMove?: readonly string[];
5646namedAccountPromotionKeys?: readonly string[];
@@ -72,18 +62,15 @@ function getChannelSetupPromotionSurface(
7262return setup as ChannelSetupPromotionSurface;
7363}
746475-function isStaticSingleAccountPromotionKey(channelKey: string, key: string): boolean {
76-if (COMMON_SINGLE_ACCOUNT_KEYS_TO_MOVE.has(key)) {
77-return true;
78-}
79-return BUNDLED_SINGLE_ACCOUNT_PROMOTION_FALLBACKS[channelKey]?.includes(key) ?? false;
65+function isStaticSingleAccountPromotionKey(key: string): boolean {
66+return COMMON_SINGLE_ACCOUNT_KEYS_TO_MOVE.has(key);
8067}
81688269export function shouldMoveSingleAccountChannelKey(params: {
8370channelKey: string;
8471key: string;
8572}): boolean {
86-if (isStaticSingleAccountPromotionKey(params.channelKey, params.key)) {
73+if (isStaticSingleAccountPromotionKey(params.key)) {
8774return true;
8875}
8976const contractKeys = getChannelSetupPromotionSurface(params.channelKey, {
@@ -118,7 +105,7 @@ export function resolveSingleAccountKeysToMove(params: {
118105};
119106120107const keysToMove = entries.filter((key) => {
121-if (isStaticSingleAccountPromotionKey(params.channelKey, key)) {
108+if (isStaticSingleAccountPromotionKey(key)) {
122109return true;
123110}
124111return Boolean(resolveSetupSurface()?.singleAccountKeysToMove?.includes(key));
@@ -128,9 +115,7 @@ export function resolveSingleAccountKeysToMove(params: {
128115}
129116130117const namedAccountPromotionKeys =
131-setupSurface?.namedAccountPromotionKeys ??
132-getChannelSetupPromotionSurface(params.channelKey)?.namedAccountPromotionKeys ??
133-BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKS[params.channelKey];
118+setupSurface?.namedAccountPromotionKeys ?? resolveSetupSurface()?.namedAccountPromotionKeys;
134119if (!namedAccountPromotionKeys) {
135120return keysToMove;
136121}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。