mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 05:00:21 +00:00
refactor: share onboarding account id resolution prelude
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
hasConfiguredSecretInput,
|
||||
mergeAllowFromEntries,
|
||||
promptSingleChannelSecretInput,
|
||||
promptAccountId,
|
||||
resolveAccountIdForConfigure,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
normalizeAccountId,
|
||||
type SecretInput,
|
||||
@@ -202,22 +202,16 @@ export const nextcloudTalkOnboardingAdapter: ChannelOnboardingAdapter = {
|
||||
shouldPromptAccountIds,
|
||||
forceAllowFrom,
|
||||
}) => {
|
||||
const nextcloudTalkOverride = accountOverrides["nextcloud-talk"]?.trim();
|
||||
const defaultAccountId = resolveDefaultNextcloudTalkAccountId(cfg as CoreConfig);
|
||||
let accountId = nextcloudTalkOverride
|
||||
? normalizeAccountId(nextcloudTalkOverride)
|
||||
: defaultAccountId;
|
||||
|
||||
if (shouldPromptAccountIds && !nextcloudTalkOverride) {
|
||||
accountId = await promptAccountId({
|
||||
cfg: cfg as CoreConfig,
|
||||
prompter,
|
||||
label: "Nextcloud Talk",
|
||||
currentId: accountId,
|
||||
listAccountIds: listNextcloudTalkAccountIds as (cfg: OpenClawConfig) => string[],
|
||||
defaultAccountId,
|
||||
});
|
||||
}
|
||||
const accountId = await resolveAccountIdForConfigure({
|
||||
cfg,
|
||||
prompter,
|
||||
label: "Nextcloud Talk",
|
||||
accountOverride: accountOverrides["nextcloud-talk"],
|
||||
shouldPromptAccountIds,
|
||||
listAccountIds: listNextcloudTalkAccountIds as (cfg: OpenClawConfig) => string[],
|
||||
defaultAccountId,
|
||||
});
|
||||
|
||||
let next = cfg as CoreConfig;
|
||||
const resolvedAccount = resolveNextcloudTalkAccount({
|
||||
|
||||
Reference in New Issue
Block a user