mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Save draft while typing
This commit is contained in:
parent
af2fc9ac76
commit
e665562db7
@ -578,7 +578,7 @@ const EditBox: Component<{
|
||||
const [isPostingInProgress, setIsPostingInProgress] = createSignal(false);
|
||||
|
||||
const postNote = async () => {
|
||||
if (!account || !account.hasPublicKey() || fileToUpload() || isInputting()) {
|
||||
if (!account || !account.hasPublicKey() || fileToUpload()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -997,19 +997,20 @@ const EditBox: Component<{
|
||||
return content;
|
||||
};
|
||||
|
||||
const [isInputting, setIsInputting] = createSignal(false);
|
||||
|
||||
const onInput = (e: InputEvent) => {
|
||||
if (fileToUpload()) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
setIsInputting(true);
|
||||
|
||||
// debounce(() => {
|
||||
setIsInputting(false);
|
||||
textArea && setMessage(textArea.value)
|
||||
// }, 500)
|
||||
if (textArea) {
|
||||
textArea && setMessage(textArea.value);
|
||||
|
||||
// save draft just in case there is an unintended interuption
|
||||
saveNoteDraft(account?.publicKey, textArea?.value, props.replyToNote?.post.noteId);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
let delayForMedia = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user