Merge remote-tracking branch 'misskey-dev/develop' into io
This commit is contained in:
commit
fd696a9621
113 changed files with 2272 additions and 443 deletions
|
@ -260,7 +260,13 @@ const maxTextLength = computed((): number => {
|
|||
|
||||
const canPost = computed((): boolean => {
|
||||
return !props.mock && !posting.value && !posted.value &&
|
||||
(1 <= textLength.value || 1 <= files.value.length || !!poll.value || !!props.renote) &&
|
||||
(
|
||||
1 <= textLength.value ||
|
||||
1 <= files.value.length ||
|
||||
poll.value != null ||
|
||||
props.renote != null ||
|
||||
(props.reply != null && quoteId.value != null)
|
||||
) &&
|
||||
(textLength.value <= maxTextLength.value) &&
|
||||
(!poll.value || poll.value.choices.length >= 2);
|
||||
});
|
||||
|
@ -389,7 +395,7 @@ function addMissingMention() {
|
|||
for (const x of extractMentions(ast)) {
|
||||
if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
|
||||
misskeyApi('users/show', { username: x.username, host: x.host }).then(user => {
|
||||
visibleUsers.value.push(user);
|
||||
pushVisibleUser(user);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -682,6 +688,7 @@ function saveDraft() {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
files: files.value.filter(f => f?.id && f.type && f.name),
|
||||
poll: poll.value,
|
||||
visibleUserIds: visibility.value === 'specified' ? visibleUsers.value.map(x => x.id) : undefined,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -958,6 +965,15 @@ onMounted(() => {
|
|||
if (draft.data.poll) {
|
||||
poll.value = draft.data.poll;
|
||||
}
|
||||
if (draft.data.visibleUserIds) {
|
||||
misskeyApi('users/show', { userIds: draft.data.visibleUserIds }).then(users => {
|
||||
for (let i = 0; i < users.length; i++) {
|
||||
if (users[i].id === draft.data.visibleUserIds[i]) {
|
||||
pushVisibleUser(users[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue