mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
refactor: remove redundant whatsapp setup conversions
This commit is contained in:
@@ -124,7 +124,7 @@ async function promptWhatsAppOwnerAllowFrom(params: {
|
||||
placeholder: "+15555550123",
|
||||
initialValue: existingAllowFrom[0],
|
||||
validate: (value) => {
|
||||
const raw = String(value ?? "").trim();
|
||||
const raw = value.trim();
|
||||
if (!raw) {
|
||||
return "Required";
|
||||
}
|
||||
@@ -136,7 +136,7 @@ async function promptWhatsAppOwnerAllowFrom(params: {
|
||||
},
|
||||
});
|
||||
|
||||
const normalized = normalizeE164(String(entry).trim());
|
||||
const normalized = normalizeE164(entry.trim());
|
||||
if (!normalized) {
|
||||
throw new Error("Invalid WhatsApp owner number (expected E.164 after validation).");
|
||||
}
|
||||
@@ -311,7 +311,7 @@ async function promptWhatsAppDmAccess(params: {
|
||||
message: "Allowed sender numbers (comma-separated, E.164)",
|
||||
placeholder: "+15555550123, +447700900123",
|
||||
validate: (value) => {
|
||||
const raw = String(value ?? "").trim();
|
||||
const raw = value.trim();
|
||||
if (!raw) {
|
||||
return "Required";
|
||||
}
|
||||
@@ -326,7 +326,7 @@ async function promptWhatsAppDmAccess(params: {
|
||||
},
|
||||
});
|
||||
|
||||
const parsed = parseWhatsAppAllowFromEntries(String(allowRaw));
|
||||
const parsed = parseWhatsAppAllowFromEntries(allowRaw);
|
||||
return setWhatsAppAllowFrom(next, accountId, parsed.entries);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user