mirror of https://github.com/openclaw/openclaw.git
fix: honor discord default setup status
This commit is contained in:
parent
8158597f84
commit
6317fce9cb
|
|
@ -109,10 +109,7 @@ export function createDiscordSetupWizardBase(handlers: {
|
|||
configuredScore: 2,
|
||||
unconfiguredScore: 1,
|
||||
resolveConfigured: ({ cfg, accountId }) =>
|
||||
(accountId ? [accountId] : listDiscordSetupAccountIds(cfg)).some((resolvedAccountId) => {
|
||||
const account = inspectDiscordSetupAccount({ cfg, accountId: resolvedAccountId });
|
||||
return account.configured;
|
||||
}),
|
||||
inspectDiscordSetupAccount({ cfg, accountId }).configured,
|
||||
}),
|
||||
credentials: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,3 +54,28 @@ describe("discordSetupWizard.dmPolicy", () => {
|
|||
expect(next?.channels?.discord?.accounts?.alerts?.allowFrom).toEqual(["123", "*"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("discordSetupWizard.status", () => {
|
||||
it("uses configured defaultAccount for omitted setup configured state", async () => {
|
||||
const configured = await discordSetupWizard.status.resolveConfigured({
|
||||
cfg: {
|
||||
channels: {
|
||||
discord: {
|
||||
defaultAccount: "work",
|
||||
token: "discord-root-token",
|
||||
accounts: {
|
||||
alerts: {
|
||||
token: "discord-alerts-token",
|
||||
},
|
||||
work: {
|
||||
token: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig,
|
||||
});
|
||||
|
||||
expect(configured).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue