mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 03:17:38 -07:00
[client] Clean up note edits
This commit is contained in:
parent
500a85acb9
commit
0719d9abbc
1 changed files with 27 additions and 20 deletions
|
@ -727,7 +727,7 @@ async function onPaste(ev: ClipboardEvent) {
|
|||
|
||||
const paste = ev.clipboardData.getData("text");
|
||||
|
||||
if (!props.renote && !quoteId && paste.startsWith(url + "/notes/")) {
|
||||
if (!props.renote && !quoteId && paste.startsWith(url + "/notes/") && !props.editId) {
|
||||
ev.preventDefault();
|
||||
|
||||
os.yesno({
|
||||
|
@ -828,8 +828,15 @@ function deleteDraft() {
|
|||
async function post() {
|
||||
const processedText = preprocess(text);
|
||||
|
||||
let postData = {
|
||||
editId: props.editId ? props.editId : undefined,
|
||||
let postData = props.editId
|
||||
? {
|
||||
editId: props.editId,
|
||||
text: processedText === "" ? undefined : processedText,
|
||||
fileIds: files.length > 0 ? files.map((f) => f.id) : undefined,
|
||||
poll: poll,
|
||||
cw: useCw ? cw || "" : undefined,
|
||||
}
|
||||
: {
|
||||
text: processedText === "" ? undefined : processedText,
|
||||
fileIds: files.length > 0 ? files.map((f) => f.id) : undefined,
|
||||
replyId: props.reply ? props.reply.id : undefined,
|
||||
|
|
Loading…
Reference in a new issue