update nostr pubkey to be nullable

This commit is contained in:
keyan 2023-02-10 16:09:26 -06:00
parent 97f74da0fd
commit 0d0940069a
1 changed files with 3 additions and 3 deletions

View File

@ -186,10 +186,10 @@ export const amountSchema = Yup.object({
export const settingsSchema = Yup.object({ export const settingsSchema = Yup.object({
tipDefault: intValidator.required('required').positive('must be positive'), tipDefault: intValidator.required('required').positive('must be positive'),
fiatCurrency: Yup.string().required('required').oneOf(SUPPORTED_CURRENCIES), fiatCurrency: Yup.string().required('required').oneOf(SUPPORTED_CURRENCIES),
nostrPubkey: Yup.string() nostrPubkey: Yup.string().nullable()
.or([ .or([
Yup.string().matches(NOSTR_PUBKEY_HEX, 'must be 64 hex chars'), Yup.string().nullable().matches(NOSTR_PUBKEY_HEX, 'must be 64 hex chars'),
Yup.string().matches(NOSTR_PUBKEY_BECH32, 'invalid bech32 encoding')], 'invalid pubkey'), Yup.string().nullable().matches(NOSTR_PUBKEY_BECH32, 'invalid bech32 encoding')], 'invalid pubkey'),
nostrRelays: Yup.array().of( nostrRelays: Yup.array().of(
Yup.string().matches(WS_REGEXP, 'invalid web socket address') Yup.string().matches(WS_REGEXP, 'invalid web socket address')
).max(NOSTR_MAX_RELAY_NUM, ).max(NOSTR_MAX_RELAY_NUM,