Fix channel configured status (#44)

This commit is contained in:
paisley
2026-02-11 11:44:06 +08:00
committed by GitHub
Unverified
parent 92c1b68a54
commit 01f4d4800e
2 changed files with 31 additions and 12 deletions

View File

@@ -271,6 +271,22 @@ export function deleteChannelConfig(channelType: string): void {
delete currentConfig.channels[channelType];
writeOpenClawConfig(currentConfig);
console.log(`Deleted channel config for ${channelType}`);
} else if (PLUGIN_CHANNELS.includes(channelType)) {
// Handle plugin channels (like whatsapp)
if (currentConfig.plugins?.entries?.[channelType]) {
delete currentConfig.plugins.entries[channelType];
// Cleanup empty objects
if (Object.keys(currentConfig.plugins.entries).length === 0) {
delete currentConfig.plugins.entries;
}
if (currentConfig.plugins && Object.keys(currentConfig.plugins).length === 0) {
delete currentConfig.plugins;
}
writeOpenClawConfig(currentConfig);
console.log(`Deleted plugin channel config for ${channelType}`);
}
}
// Special handling for WhatsApp credentials