From a3fd51d6e0dc5d89f88efe881cebf35b36417575 Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Thu, 16 Nov 2023 23:47:44 +0100
Subject: upd: change the way likes get handled

---
 packages/frontend/src/components/MkNoteSub.vue | 11 +++++------
 1 file changed, 5 insertions(+), 6 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 85d1203831..94f52b7f5d 100644
--- a/packages/frontend/src/components/MkNoteSub.vue
+++ b/packages/frontend/src/components/MkNoteSub.vue
@@ -110,7 +110,6 @@ const canRenote = computed(() => ['public', 'home'].includes(props.note.visibili
 
 const props = withDefaults(defineProps<{
 	note: Misskey.entities.Note;
-	meta: Misskey.entities.LiteInstanceMetadata;
 	detail?: boolean;
 	expandAllCws?: boolean;
 
@@ -134,7 +133,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 defaultLike = computed(() => defaultStore.state.like !== '❤️' ? defaultStore.state.like : null);
 
 const isRenote = (
 	props.note.renote != null &&
@@ -188,9 +187,9 @@ function react(viaKeyboard = false): void {
 	pleaseLogin();
 	showMovedDialog();
 	if (props.note.reactionAcceptance === 'likeOnly') {
-		os.api('notes/reactions/create', {
+		os.api('notes/like', {
 			noteId: props.note.id,
-			reaction: defaultLike.value,
+			override: defaultLike.value,
 		});
 		const el = reactButton.value as HTMLElement | null | undefined;
 		if (el) {
@@ -218,9 +217,9 @@ function react(viaKeyboard = false): void {
 function like(): void {
 	pleaseLogin();
 	showMovedDialog();
-	os.api('notes/reactions/create', {
+	os.api('notes/like', {
 		noteId: props.note.id,
-		reaction: defaultLike.value,
+		override: defaultLike.value,
 	});
 	const el = reactButton.value as HTMLElement | null | undefined;
 	if (el) {
-- 
cgit v1.2.3-freya

