I forgot to add the dependency ಠ_ಠ

This commit is contained in:
nelle 2024-07-14 07:23:28 -06:00
parent d29b7e794c
commit a380686ba3
2 changed files with 4 additions and 1 deletions

View file

@ -45,6 +45,7 @@ import * as os from "@/os";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
import * as sound from "@/scripts/sound.js";
const props = defineProps<{ const props = defineProps<{
note: Note; note: Note;
@ -52,6 +53,7 @@ const props = defineProps<{
function star(ev?: MouseEvent): void { function star(ev?: MouseEvent): void {
pleaseLogin(); pleaseLogin();
sound.play("reaction");
os.api("notes/reactions/create", { os.api("notes/reactions/create", {
noteId: props.note.id, noteId: props.note.id,
reaction: reaction:

View file

@ -51,6 +51,7 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
import { useTooltip } from "@/scripts/use-tooltip"; import { useTooltip } from "@/scripts/use-tooltip";
import * as sound from "@/scripts/sound.js";
const props = defineProps<{ const props = defineProps<{
note: Note; note: Note;
@ -63,6 +64,7 @@ const buttonRef = ref<HTMLElement>();
function toggleStar(ev?: MouseEvent): void { function toggleStar(ev?: MouseEvent): void {
pleaseLogin(); pleaseLogin();
if (!props.reacted) { if (!props.reacted) {
sound.play("reaction");
os.api("notes/reactions/create", { os.api("notes/reactions/create", {
noteId: props.note.id, noteId: props.note.id,
reaction: instance.defaultReaction, reaction: instance.defaultReaction,
@ -75,7 +77,6 @@ function toggleStar(ev?: MouseEvent): void {
const x = rect.left + el.offsetWidth / 2; const x = rect.left + el.offsetWidth / 2;
const y = rect.top + el.offsetHeight / 2; const y = rect.top + el.offsetHeight / 2;
os.popup(Ripple, { x, y }, {}, "end"); os.popup(Ripple, { x, y }, {}, "end");
sound.play("reaction");
} }
} else { } else {
os.api("notes/reactions/delete", { os.api("notes/reactions/delete", {