upd: Allow users to change default like emoji

When users change the default like emoji in reactions tab from heart to another one it will be send out as that specific emoji.

If reset back to heart it will default to the instance like emoji again which is heart by default.

Closes transfem-org/Sharkey#95
This commit is contained in:
Mar0xy 2023-11-16 00:22:12 +01:00
parent 62bb0d1eaa
commit 490b249407
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
5 changed files with 36 additions and 6 deletions

View file

@ -323,6 +323,7 @@ const conversation = ref<Misskey.entities.Note[]>([]);
const replies = ref<Misskey.entities.Note[]>([]);
const quotes = ref<Misskey.entities.Note[]>([]);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id);
const defaultLike = computed(() => defaultStore.state.like !== '❤️' ? defaultStore.state.like : meta.defaultLike);
watch(() => props.expandAllCws, (expandAllCws) => {
if (expandAllCws !== showContent.value) showContent.value = expandAllCws;
@ -558,7 +559,7 @@ function react(viaKeyboard = false): void {
if (appearNote.reactionAcceptance === 'likeOnly') {
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: meta.defaultLike,
reaction: defaultLike.value,
});
const el = reactButton.value as HTMLElement | null | undefined;
if (el) {
@ -588,7 +589,7 @@ function like(): void {
showMovedDialog();
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: meta.defaultLike,
reaction: defaultLike.value,
});
const el = likeButton.value as HTMLElement | null | undefined;
if (el) {