mirror of https://github.com/openclaw/openclaw.git
fix: honor nextcloud default setup status
This commit is contained in:
parent
5ec53fff0c
commit
5d3edb1d40
|
|
@ -34,17 +34,8 @@ export const nextcloudTalkSetupWizard: ChannelSetupWizard = {
|
|||
configuredScore: 1,
|
||||
unconfiguredScore: 5,
|
||||
resolveConfigured: ({ cfg, accountId }) => {
|
||||
if (accountId) {
|
||||
const account = resolveNextcloudTalkAccount({ cfg: cfg as CoreConfig, accountId });
|
||||
return Boolean(account.secret && account.baseUrl);
|
||||
}
|
||||
return listNextcloudTalkAccountIds(cfg as CoreConfig).some((resolvedAccountId) => {
|
||||
const account = resolveNextcloudTalkAccount({
|
||||
cfg: cfg as CoreConfig,
|
||||
accountId: resolvedAccountId,
|
||||
});
|
||||
return Boolean(account.secret && account.baseUrl);
|
||||
});
|
||||
const account = resolveNextcloudTalkAccount({ cfg: cfg as CoreConfig, accountId });
|
||||
return Boolean(account.secret && account.baseUrl);
|
||||
},
|
||||
}),
|
||||
introNote: {
|
||||
|
|
|
|||
|
|
@ -387,4 +387,30 @@ describe("resolveNextcloudTalkAccount", () => {
|
|||
expect(account.secret).toBe("work-secret");
|
||||
expect(account.secretSource).toBe("config");
|
||||
});
|
||||
|
||||
it("uses configured defaultAccount for omitted setup configured state", () => {
|
||||
const configured = nextcloudTalkSetupWizard.status.resolveConfigured({
|
||||
cfg: {
|
||||
channels: {
|
||||
"nextcloud-talk": {
|
||||
defaultAccount: "work",
|
||||
baseUrl: "https://root.example.com",
|
||||
botSecret: "root-secret",
|
||||
accounts: {
|
||||
alerts: {
|
||||
baseUrl: "https://alerts.example.com",
|
||||
botSecret: "alerts-secret",
|
||||
},
|
||||
work: {
|
||||
baseUrl: "",
|
||||
botSecret: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
});
|
||||
|
||||
expect(configured).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue