[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");
|
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();
|
ev.preventDefault();
|
||||||
|
|
||||||
os.yesno({
|
os.yesno({
|
||||||
|
|
@ -828,26 +828,33 @@ function deleteDraft() {
|
||||||
async function post() {
|
async function post() {
|
||||||
const processedText = preprocess(text);
|
const processedText = preprocess(text);
|
||||||
|
|
||||||
let postData = {
|
let postData = props.editId
|
||||||
editId: props.editId ? props.editId : undefined,
|
? {
|
||||||
text: processedText === "" ? undefined : processedText,
|
editId: props.editId,
|
||||||
fileIds: files.length > 0 ? files.map((f) => f.id) : undefined,
|
text: processedText === "" ? undefined : processedText,
|
||||||
replyId: props.reply ? props.reply.id : undefined,
|
fileIds: files.length > 0 ? files.map((f) => f.id) : undefined,
|
||||||
renoteId: props.renote
|
poll: poll,
|
||||||
? props.renote.id
|
cw: useCw ? cw || "" : undefined,
|
||||||
: quoteId
|
}
|
||||||
? quoteId
|
: {
|
||||||
: undefined,
|
text: processedText === "" ? undefined : processedText,
|
||||||
channelId: props.channel ? props.channel.id : undefined,
|
fileIds: files.length > 0 ? files.map((f) => f.id) : undefined,
|
||||||
poll: poll,
|
replyId: props.reply ? props.reply.id : undefined,
|
||||||
cw: useCw ? cw || "" : undefined,
|
renoteId: props.renote
|
||||||
localOnly: localOnly,
|
? props.renote.id
|
||||||
visibility: visibility,
|
: quoteId
|
||||||
visibleUserIds:
|
? quoteId
|
||||||
visibility === "specified"
|
|
||||||
? visibleUsers.map((u) => u.id)
|
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
channelId: props.channel ? props.channel.id : undefined,
|
||||||
|
poll: poll,
|
||||||
|
cw: useCw ? cw || "" : undefined,
|
||||||
|
localOnly: localOnly,
|
||||||
|
visibility: visibility,
|
||||||
|
visibleUserIds:
|
||||||
|
visibility === "specified"
|
||||||
|
? visibleUsers.map((u) => u.id)
|
||||||
|
: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
if (withHashtags && hashtags && hashtags.trim() !== "") {
|
if (withHashtags && hashtags && hashtags.trim() !== "") {
|
||||||
const hashtags_ = hashtags
|
const hashtags_ = hashtags
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue