From e9f5f3cf79a8fd4941c814d57f4c6fe2cff5ff95 Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Sat, 14 Oct 2023 11:40:52 +0200 Subject: [PATCH] Remove name warning, add all default relays to new account --- src/pages/CreateAccount.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/CreateAccount.tsx b/src/pages/CreateAccount.tsx index 9de1c03..0c19571 100644 --- a/src/pages/CreateAccount.tsx +++ b/src/pages/CreateAccount.tsx @@ -61,6 +61,7 @@ const CreateAccount: Component = () => { const intl = useIntl(); const [avatarPreview, setAvatarPreview] = createSignal(); const [bannerPreview, setBannerPreview] = createSignal(); + const [accountName, setAccountName] = createSignal(''); const [isNameValid, setIsNameValid] = createSignal(false); const flagBannerForWarning = () => { @@ -121,6 +122,7 @@ const CreateAccount: Component = () => { const intl = useIntl(); const onNameInput = () => { const value = nameInput?.value || ''; + setAccountName(() => value); setIsNameValid(usernameRegex.test(value)) }; @@ -219,7 +221,7 @@ const CreateAccount: Component = () => { const intl = useIntl(); return false; } - let relaySettings = getPreConfiguredRelays(); + let relaySettings = account.defaultRelays.reduce((acc, r) => ({ ...acc, [r]: { write: true, read: true }}), {}); let metadata: Record = {}; @@ -525,7 +527,7 @@ const CreateAccount: Component = () => { const intl = useIntl(); onInput={onNameInput} /> - + 0 && !isNameValid()}>
{intl.formatMessage(tSettings.profile.name.error)}