parent
722f10b7fa
commit
c3ced9b75f
23 changed files with 176 additions and 22 deletions
|
|
@ -174,7 +174,7 @@ const props = withDefaults(defineProps<{
|
|||
fixed?: boolean;
|
||||
autofocus?: boolean;
|
||||
freezeAfterPosted?: boolean;
|
||||
|
||||
updateMode?: boolean;
|
||||
}>(), {
|
||||
initialVisibleUsers: () => [],
|
||||
autofocus: true,
|
||||
|
|
@ -742,7 +742,8 @@ async function post(ev?: MouseEvent) {
|
|||
visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined,
|
||||
reactionAcceptance,
|
||||
|
||||
};
|
||||
noteId: props.updateMode ? props.initialNote?.id : undefined,
|
||||
};
|
||||
|
||||
if (withHashtags && hashtags && hashtags.trim() !== '') {
|
||||
const hashtags_ = hashtags.trim().split(' ').map(x => x.startsWith('#') ? x : '#' + x).join(' ');
|
||||
|
|
@ -764,7 +765,7 @@ async function post(ev?: MouseEvent) {
|
|||
}
|
||||
|
||||
posting = true;
|
||||
os.api('notes/create', postData, token).then(() => {
|
||||
os.api(props.updateMode ? 'notes/update' : 'notes/create', postData, token).then(() => {
|
||||
if (props.freezeAfterPosted) {
|
||||
posted = true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue