1
0

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
5 changed files with 36 additions and 6 deletions
+3 -2
View File
@@ -280,6 +280,7 @@ const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id));
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
const defaultLike = computed(() => defaultStore.state.like !== '❤️' ? defaultStore.state.like : props.meta.defaultLike);
const keymap = {
'r': () => reply(true),
@@ -513,7 +514,7 @@ function like(): void {
}
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: props.meta.defaultLike,
reaction: defaultLike.value,
});
const el = likeButton.value as HTMLElement | null | undefined;
if (el) {
@@ -534,7 +535,7 @@ function react(viaKeyboard = false): void {
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: props.meta.defaultLike,
reaction: defaultLike.value,
});
const el = reactButton.value as HTMLElement | null | undefined;
if (el) {
@@ -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) {
@@ -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) {