This commit is contained in:
QLHazyCoder
2026-05-20 04:02:39 +08:00
8 changed files with 149 additions and 14 deletions
+22
View File
@@ -868,6 +868,9 @@ function getStepDefinitionsForMode(plusModeEnabled = false, options = {}) {
const phoneSignupReloginAfterBindEmailEnabled = typeof options === 'string'
? currentPhoneSignupReloginAfterBindEmailEnabled
: Boolean(options.phoneSignupReloginAfterBindEmailEnabled ?? currentPhoneSignupReloginAfterBindEmailEnabled);
const accountContributionEnabled = typeof options === 'string'
? Boolean(typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false)
: Boolean(options.accountContributionEnabled ?? (typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false));
const activeFlowId = typeof options === 'string'
? ((typeof latestState !== 'undefined' ? latestState?.activeFlowId : '') || defaultFlowId)
: (options.activeFlowId || (typeof latestState !== 'undefined' ? latestState?.activeFlowId : '') || defaultFlowId);
@@ -878,6 +881,7 @@ function getStepDefinitionsForMode(plusModeEnabled = false, options = {}) {
plusAccountAccessStrategy: normalizePlusAccountAccessStrategy(rawPlusAccountAccessStrategy),
signupMethod: normalizeSignupMethod(rawSignupMethod),
phoneSignupReloginAfterBindEmailEnabled,
accountContributionEnabled,
}) || [])
.sort((left, right) => {
const leftOrder = Number.isFinite(left.order) ? left.order : left.id;
@@ -903,6 +907,9 @@ function getWorkflowNodesForMode(plusModeEnabled = false, options = {}) {
const phoneSignupReloginAfterBindEmailEnabled = typeof options === 'string'
? currentPhoneSignupReloginAfterBindEmailEnabled
: Boolean(options.phoneSignupReloginAfterBindEmailEnabled ?? currentPhoneSignupReloginAfterBindEmailEnabled);
const accountContributionEnabled = typeof options === 'string'
? Boolean(typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false)
: Boolean(options.accountContributionEnabled ?? (typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false));
const activeFlowId = typeof options === 'string'
? ((typeof latestState !== 'undefined' ? latestState?.activeFlowId : '') || defaultFlowId)
: (options.activeFlowId || (typeof latestState !== 'undefined' ? latestState?.activeFlowId : '') || defaultFlowId);
@@ -913,6 +920,7 @@ function getWorkflowNodesForMode(plusModeEnabled = false, options = {}) {
plusAccountAccessStrategy: normalizePlusAccountAccessStrategy(rawPlusAccountAccessStrategy),
signupMethod: normalizeSignupMethod(rawSignupMethod),
phoneSignupReloginAfterBindEmailEnabled,
accountContributionEnabled,
});
if (Array.isArray(nodes) && nodes.length) {
return nodes.slice().sort((left, right) => {
@@ -980,6 +988,10 @@ function rebuildStepDefinitionState(plusModeEnabled = false, options = {}) {
const phoneSignupReloginAfterBindEmailEnabled = typeof options === 'string'
? currentPhoneSignupReloginAfterBindEmailEnabled
: Boolean(options.phoneSignupReloginAfterBindEmailEnabled ?? currentPhoneSignupReloginAfterBindEmailEnabled);
const accountContributionEnabled = Boolean(
options.accountContributionEnabled
?? (typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false)
);
currentPlusPaymentMethod = normalizePlusPaymentMethod(rawPaymentMethod);
currentPlusAccountAccessStrategy = normalizePlusAccountAccessStrategy(rawPlusAccountAccessStrategy);
currentSignupMethod = normalizeSignupMethod(rawSignupMethod);
@@ -998,6 +1010,7 @@ function rebuildStepDefinitionState(plusModeEnabled = false, options = {}) {
plusAccountAccessStrategy: currentPlusAccountAccessStrategy,
signupMethod: currentSignupMethod,
phoneSignupReloginAfterBindEmailEnabled: currentPhoneSignupReloginAfterBindEmailEnabled,
accountContributionEnabled,
});
const nextWorkflowNodes = typeof getWorkflowNodesForMode === 'function'
? getWorkflowNodesForMode(currentPlusModeEnabled, {
@@ -1006,6 +1019,7 @@ function rebuildStepDefinitionState(plusModeEnabled = false, options = {}) {
plusAccountAccessStrategy: currentPlusAccountAccessStrategy,
signupMethod: currentSignupMethod,
phoneSignupReloginAfterBindEmailEnabled: currentPhoneSignupReloginAfterBindEmailEnabled,
accountContributionEnabled,
})
: stepDefinitions.map((step) => ({
nodeId: String(step.key || step.id || '').trim(),
@@ -10170,6 +10184,10 @@ function syncStepDefinitionsForMode(plusModeEnabled = false, plusPaymentMethodOr
? inputPhoneSignupReloginAfterBindEmail.checked
: currentPhoneSignupReloginAfterBindEmailEnabled)
);
const nextAccountContributionEnabled = Boolean(
options.accountContributionEnabled
?? (typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false)
);
const nextPaymentMethod = normalizePlusPaymentMethod(rawPaymentMethod);
const nextActiveFlowId = String(
options.activeFlowId
@@ -10196,6 +10214,7 @@ function syncStepDefinitionsForMode(plusModeEnabled = false, plusPaymentMethodOr
|| nextPlusAccountAccessStrategy !== currentPlusAccountAccessStrategy
|| nextSignupMethod !== currentSignupMethod
|| nextPhoneSignupReloginAfterBindEmailEnabled !== currentPhoneSignupReloginAfterBindEmailEnabled
|| nextAccountContributionEnabled !== Boolean(typeof latestState !== 'undefined' ? latestState?.accountContributionEnabled : false)
|| nextActiveFlowId !== currentFlowId
|| paymentTitleChanged;
if (!shouldRender) {
@@ -10208,6 +10227,7 @@ function syncStepDefinitionsForMode(plusModeEnabled = false, plusPaymentMethodOr
plusAccountAccessStrategy: nextPlusAccountAccessStrategy,
signupMethod: nextSignupMethod,
phoneSignupReloginAfterBindEmailEnabled: nextPhoneSignupReloginAfterBindEmailEnabled,
accountContributionEnabled: nextAccountContributionEnabled,
});
renderStepsList();
}
@@ -10234,6 +10254,7 @@ function syncStepDefinitionsFromUiState(stateOverrides = {}) {
plusAccountAccessStrategy: stepDefinitionState.plusAccountAccessStrategy,
signupMethod: stepDefinitionState.signupMethod,
phoneSignupReloginAfterBindEmailEnabled: Boolean(nextState?.phoneSignupReloginAfterBindEmailEnabled),
accountContributionEnabled: Boolean(nextState?.accountContributionEnabled),
});
return stepDefinitionState;
}
@@ -10257,6 +10278,7 @@ function applySettingsState(state) {
plusPaymentMethod: state?.plusPaymentMethod,
signupMethod: stepDefinitionState.signupMethod,
phoneSignupReloginAfterBindEmailEnabled: Boolean(state?.phoneSignupReloginAfterBindEmailEnabled),
accountContributionEnabled: Boolean(state?.accountContributionEnabled),
});
}
const fallbackIpProxyService = '711proxy';