@ -427,7 +427,8 @@ writeForm.addEventListener('submit', async (e) => {
if ( ! pubkey || ! privatekey ) {
if ( ! pubkey || ! privatekey ) {
return onSendError ( new Error ( 'no pubkey/privatekey' ) ) ;
return onSendError ( new Error ( 'no pubkey/privatekey' ) ) ;
}
}
if ( ! writeInput . value ) {
const content = writeInput . value . trimRight ( ) ;
if ( ! content ) {
return onSendError ( new Error ( 'message is empty' ) ) ;
return onSendError ( new Error ( 'message is empty' ) ) ;
}
}
const replyTo = localStorage . getItem ( 'reply_to' ) ;
const replyTo = localStorage . getItem ( 'reply_to' ) ;
@ -435,7 +436,7 @@ writeForm.addEventListener('submit', async (e) => {
const newEvent = {
const newEvent = {
kind : 1 ,
kind : 1 ,
pubkey ,
pubkey ,
content : writeInput . value ,
content ,
tags ,
tags ,
created _at : Math . floor ( Date . now ( ) * 0.001 ) ,
created _at : Math . floor ( Date . now ( ) * 0.001 ) ,
} ;
} ;
@ -462,7 +463,7 @@ writeForm.addEventListener('submit', async (e) => {
} ) ;
} ) ;
writeInput . addEventListener ( 'input' , ( ) => {
writeInput . addEventListener ( 'input' , ( ) => {
publish . disabled = ! writeInput . value ;
publish . disabled = ! writeInput . value .trimRight ( ) ;
updateElemHeight ( writeInput ) ;
updateElemHeight ( writeInput ) ;
} ) ;
} ) ;
writeInput . addEventListener ( 'blur' , ( ) => sendStatus . textContent = '' ) ;
writeInput . addEventListener ( 'blur' , ( ) => sendStatus . textContent = '' ) ;