refactor(onboarding): simplify zalo allowFrom merge paths

This commit is contained in:
Peter Steinberger
2026-02-16 23:04:34 +00:00
parent d89d951c3e
commit 94e4631171
2 changed files with 2 additions and 10 deletions

View File

@@ -148,11 +148,7 @@ async function promptZaloAllowFrom(params: {
},
});
const normalized = String(entry).trim();
const merged = [
...existingAllowFrom.map((item) => String(item).trim()).filter(Boolean),
normalized,
];
const unique = mergeAllowFromEntries(undefined, merged);
const unique = mergeAllowFromEntries(existingAllowFrom, [normalized]);
if (accountId === DEFAULT_ACCOUNT_ID) {
return {

View File

@@ -122,11 +122,7 @@ async function promptZalouserAllowFrom(params: {
);
continue;
}
const merged = [
...existingAllowFrom.map((item) => String(item).trim()).filter(Boolean),
...(results.filter(Boolean) as string[]),
];
const unique = mergeAllowFromEntries(undefined, merged);
const unique = mergeAllowFromEntries(existingAllowFrom, results.filter(Boolean) as string[]);
if (accountId === DEFAULT_ACCOUNT_ID) {
return {
...cfg,