From 490b249407e1a89b23b0afc274daed1cffb89a59 Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Thu, 16 Nov 2023 00:22:12 +0100
Subject: 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
---
 packages/frontend/src/components/MkNoteSub.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/MkNoteSub.vue')

diff --git a/packages/frontend/src/components/MkNoteSub.vue b/packages/frontend/src/components/MkNoteSub.vue
index 7b8d744d6a..85d1203831 100644
--- a/packages/frontend/src/components/MkNoteSub.vue
+++ b/packages/frontend/src/components/MkNoteSub.vue
@@ -134,6 +134,7 @@ const menuButton = shallowRef<HTMLElement>();
 const likeButton = shallowRef<HTMLElement>();
 
 let appearNote = $computed(() => isRenote ? props.note.renote as Misskey.entities.Note : props.note);
+const defaultLike = computed(() => defaultStore.state.like !== '❤️' ? defaultStore.state.like : props.meta.defaultLike);
 
 const isRenote = (
 	props.note.renote != null &&
@@ -189,7 +190,7 @@ function react(viaKeyboard = false): void {
 	if (props.note.reactionAcceptance === 'likeOnly') {
 		os.api('notes/reactions/create', {
 			noteId: props.note.id,
-			reaction: props.meta.defaultLike,
+			reaction: defaultLike.value,
 		});
 		const el = reactButton.value as HTMLElement | null | undefined;
 		if (el) {
@@ -219,7 +220,7 @@ function like(): void {
 	showMovedDialog();
 	os.api('notes/reactions/create', {
 		noteId: props.note.id,
-		reaction: props.meta.defaultLike,
+		reaction: defaultLike.value,
 	});
 	const el = reactButton.value as HTMLElement | null | undefined;
 	if (el) {
-- 
cgit v1.2.3-freya

