feat 11055
This commit is contained in:
parent
ebec0725f5
commit
e514c801b7
|
@ -28,6 +28,7 @@
|
||||||
- ドライブファイルのメニューで画像をクロップできるように
|
- ドライブファイルのメニューで画像をクロップできるように
|
||||||
- 画像を動画と同様に簡単に隠せるように
|
- 画像を動画と同様に簡単に隠せるように
|
||||||
- オリジナル画像を保持せずにアップロードする場合webpでアップロードされるように(Safari以外)
|
- オリジナル画像を保持せずにアップロードする場合webpでアップロードされるように(Safari以外)
|
||||||
|
- ノートのリアクションボタンのアイコンを変更し、削除をせずにリアクションを変更できるように
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- JSON.parse の回数を削減することで、ストリーミングのパフォーマンスを向上しました
|
- JSON.parse の回数を削減することで、ストリーミングのパフォーマンスを向上しました
|
||||||
|
|
|
@ -111,7 +111,6 @@
|
||||||
<i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart-plus"></i>
|
<i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart-plus"></i>
|
||||||
<i v-else class="ti ti-mood-plus"></i>
|
<i v-else class="ti ti-mood-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" :class="$style.footerButton" class="_button" @mousedown="clip()">
|
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" :class="$style.footerButton" class="_button" @mousedown="clip()">
|
||||||
<i class="ti ti-paperclip"></i>
|
<i class="ti ti-paperclip"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -105,12 +105,12 @@
|
||||||
<button v-else class="_button" :class="$style.noteFooterButton" disabled>
|
<button v-else class="_button" :class="$style.noteFooterButton" disabled>
|
||||||
<i class="ti ti-ban"></i>
|
<i class="ti ti-ban"></i>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="appearNote.myReaction == null" ref="reactButton" :class="$style.noteFooterButton" class="_button" @mousedown="react()">
|
<button v-if="appearNote.reactionAcceptance === 'likeOnly' && appearNote.myReaction != null" ref="reactButton" :class="$style.noteFooterButton" class="_button" @click="undoReact(appearNote)">
|
||||||
<i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart"></i>
|
<i class="ti ti-heart-minus"></i>
|
||||||
<i v-else class="ti ti-plus"></i>
|
|
||||||
</button>
|
</button>
|
||||||
<button v-if="appearNote.myReaction != null" ref="reactButton" class="_button" :class="[$style.noteFooterButton, $style.reacted]" @click="undoReact(appearNote)">
|
<button v-else ref="reactButton" :class="$style.noteFooterButton" class="_button" @mousedown="react()">
|
||||||
<i class="ti ti-minus"></i>
|
<i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart-plus"></i>
|
||||||
|
<i v-else class="ti ti-mood-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" class="_button" :class="$style.noteFooterButton" @mousedown="clip()">
|
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" class="_button" :class="$style.noteFooterButton" @mousedown="clip()">
|
||||||
<i class="ti ti-paperclip"></i>
|
<i class="ti ti-paperclip"></i>
|
||||||
|
@ -344,17 +344,41 @@ function react(viaKeyboard = false): void {
|
||||||
} else {
|
} else {
|
||||||
blur();
|
blur();
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
|
toggleReaction(reaction);
|
||||||
|
}, () => {
|
||||||
|
focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function toggleReaction(reaction) {
|
||||||
|
const oldReaction = note.myReaction;
|
||||||
|
if (oldReaction) {
|
||||||
|
const confirm = await os.confirm({
|
||||||
|
type: 'warning',
|
||||||
|
text: oldReaction !== reaction ? i18n.ts.changeReactionConfirm : i18n.ts.cancelReactionConfirm,
|
||||||
|
});
|
||||||
|
if (confirm.canceled) return;
|
||||||
|
|
||||||
|
os.api('notes/reactions/delete', {
|
||||||
|
noteId: note.id,
|
||||||
|
}).then(() => {
|
||||||
|
if (oldReaction !== reaction) {
|
||||||
|
os.api('notes/reactions/create', {
|
||||||
|
noteId: note.id,
|
||||||
|
reaction: reaction,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
os.api('notes/reactions/create', {
|
os.api('notes/reactions/create', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
if (appearNote.text && appearNote.text.length > 100 && (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 3)) {
|
if (appearNote.text && appearNote.text.length > 100 && (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 3)) {
|
||||||
claimAchievement('reactWithoutRead');
|
claimAchievement('reactWithoutRead');
|
||||||
}
|
}
|
||||||
}, () => {
|
|
||||||
focus();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function undoReact(note): void {
|
function undoReact(note): void {
|
||||||
|
|
Loading…
Reference in a new issue