align Sk & Mk variants of components

some whitespace, some types, a missing sound, and a probably wrong API
URL
This commit is contained in:
dakkar 2024-01-21 12:37:41 +00:00
parent 9d3f34d88f
commit f87483feb7
5 changed files with 20 additions and 18 deletions

View File

@ -606,7 +606,7 @@ function react(viaKeyboard = false): void {
return; return;
} }
misskeyApi('notes/reactions/create', { misskeyApi('notes/like', {
noteId: appearNote.value.id, noteId: appearNote.value.id,
override: defaultLike.value, override: defaultLike.value,
}); });

View File

@ -374,16 +374,16 @@ const reactionsPagination = computed(() => ({
})); }));
async function addReplyTo(replyNote: Misskey.entities.Note) { async function addReplyTo(replyNote: Misskey.entities.Note) {
replies.value.unshift(replyNote); replies.value.unshift(replyNote);
appearNote.value.repliesCount += 1; appearNote.value.repliesCount += 1;
} }
async function removeReply(id: Misskey.entities.Note['id']) { async function removeReply(id: Misskey.entities.Note['id']) {
const replyIdx = replies.value.findIndex(note => note.id === id); const replyIdx = replies.value.findIndex(note => note.id === id);
if (replyIdx >= 0) { if (replyIdx >= 0) {
replies.value.splice(replyIdx, 1); replies.value.splice(replyIdx, 1);
appearNote.value.repliesCount -= 1; appearNote.value.repliesCount -= 1;
} }
} }
useNoteCapture({ useNoteCapture({

View File

@ -145,16 +145,16 @@ const isRenote = (
); );
async function addReplyTo(replyNote: Misskey.entities.Note) { async function addReplyTo(replyNote: Misskey.entities.Note) {
replies.value.unshift(replyNote); replies.value.unshift(replyNote);
appearNote.value.repliesCount += 1; appearNote.value.repliesCount += 1;
} }
async function removeReply(id: Misskey.entities.Note['id']) { async function removeReply(id: Misskey.entities.Note['id']) {
const replyIdx = replies.value.findIndex(note => note.id === id); const replyIdx = replies.value.findIndex(note => note.id === id);
if (replyIdx >= 0) { if (replyIdx >= 0) {
replies.value.splice(replyIdx, 1); replies.value.splice(replyIdx, 1);
appearNote.value.repliesCount -= 1; appearNote.value.repliesCount -= 1;
} }
} }
useNoteCapture({ useNoteCapture({

View File

@ -299,7 +299,7 @@ const isDeleted = ref(false);
const renoted = ref(false); const renoted = ref(false);
const muted = ref(checkMute(appearNote.value, $i?.mutedWords)); const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true)); const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true));
const translation = ref<any>(null); const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false); const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i.id)); const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i.id));

View File

@ -319,7 +319,7 @@ const showContent = ref(defaultStore.state.uncollapseCW);
const isDeleted = ref(false); const isDeleted = ref(false);
const renoted = ref(false); const renoted = ref(false);
const muted = ref($i ? checkWordMute(appearNote.value, $i, $i.mutedWords) : false); const muted = ref($i ? checkWordMute(appearNote.value, $i, $i.mutedWords) : false);
const translation = ref(null); const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false); const translating = ref(false);
const parsed = appearNote.value.text ? mfm.parse(appearNote.value.text) : null; const parsed = appearNote.value.text ? mfm.parse(appearNote.value.text) : null;
const urls = parsed ? extractUrlFromMfm(parsed).filter(u => u !== renoteUrl && u !== renoteUri) : null; const urls = parsed ? extractUrlFromMfm(parsed).filter(u => u !== renoteUrl && u !== renoteUri) : null;
@ -363,7 +363,7 @@ provide('react', (reaction: string) => {
}); });
const tab = ref('replies'); const tab = ref('replies');
const reactionTabType = ref(null); const reactionTabType = ref<string | null>(null);
const renotesPagination = computed(() => ({ const renotesPagination = computed(() => ({
endpoint: 'notes/renotes', endpoint: 'notes/renotes',
@ -606,6 +606,8 @@ function react(viaKeyboard = false): void {
pleaseLogin(); pleaseLogin();
showMovedDialog(); showMovedDialog();
if (appearNote.value.reactionAcceptance === 'likeOnly') { if (appearNote.value.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
misskeyApi('notes/like', { misskeyApi('notes/like', {
noteId: appearNote.value.id, noteId: appearNote.value.id,
override: defaultLike.value, override: defaultLike.value,