fix: Unable do configure fully qualified accounts

This commit is contained in:
Marcel Hellkamp 2023-07-16 17:16:04 +02:00
parent f59515adf9
commit 61af1d552c

View File

@ -27,9 +27,10 @@ const formTags = computed({
set: (value) => config.value.tags = (value || "").replace(/[^a-z0-9]+/ig, " ").split(" ").filter(t => t.length),
});
const accountPattern = /\b([A-Z0-9._%+-]+)(@([A-Z0-9.-]+\.[A-Z]{2,}))?\b/ig;
const formAccounts = computed({
get: () => config.value.accounts.map(t => "@" + t).join(" "),
set: (value) => config.value.accounts = (value || "").replace(/[^a-z0-9]+/ig, " ").split(" ").filter(t => t.length),
set: (value) => config.value.accounts = [...(value || "").matchAll(accountPattern)].map(m => m[0]).filter(t => t.length),
});
const formLimit = computed({
@ -44,7 +45,7 @@ const formInterval = computed({
const formInfo = computed({
get: () => config.value.info,
set: (value) => config.value.info = value === "top" ? "top" : "hidden",
set: (value) => config.value.info = value === "top" ? "top" : "hide",
});