mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Remove name warning, add all default relays to new account
This commit is contained in:
parent
4cbb8da345
commit
e9f5f3cf79
@ -61,6 +61,7 @@ const CreateAccount: Component = () => { const intl = useIntl();
|
||||
const [avatarPreview, setAvatarPreview] = createSignal<string>();
|
||||
const [bannerPreview, setBannerPreview] = createSignal<string>();
|
||||
|
||||
const [accountName, setAccountName] = createSignal('');
|
||||
const [isNameValid, setIsNameValid] = createSignal<boolean>(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<string, string> = {};
|
||||
|
||||
@ -525,7 +527,7 @@ const CreateAccount: Component = () => { const intl = useIntl();
|
||||
onInput={onNameInput}
|
||||
/>
|
||||
</div>
|
||||
<Show when={!isNameValid()}>
|
||||
<Show when={accountName().length > 0 && !isNameValid()}>
|
||||
<div class={styles.inputError}>
|
||||
{intl.formatMessage(tSettings.profile.name.error)}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user