Merge remote-tracking branch 'misskey-original/develop' into develop

# Conflicts:
#	packages/frontend/src/components/MkNote.vue
This commit is contained in:
mattyatea 2023-11-26 18:20:21 +09:00
commit 072b228568
36 changed files with 256 additions and 84 deletions

View file

@ -37,6 +37,7 @@ import * as Misskey from 'misskey-js';
import bytes from '@/filters/bytes.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
import hasAudio from '@/scripts/media-has-audio.js';
const props = defineProps<{
video: Misskey.entities.DriveFile;
@ -49,6 +50,12 @@ const videoEl = shallowRef<HTMLVideoElement>();
watch(videoEl, () => {
if (videoEl.value) {
videoEl.value.volume = 0.3;
hasAudio(videoEl.value).then(had => {
if (!had) {
videoEl.value.loop = videoEl.value.muted = true;
videoEl.value.play();
}
});
}
});
</script>

View file

@ -171,6 +171,7 @@ import {focusPrev, focusNext} from '@/scripts/focus.js';
import {checkWordMute} from '@/scripts/check-word-mute.js';
import {userPage} from '@/filters/user.js';
import * as os from '@/os.js';
import * as sound from '@/scripts/sound.js';
import {defaultStore, noteViewInterruptors} from '@/store.js';
import {reactionPicker} from '@/scripts/reaction-picker.js';
import {extractUrlFromMfm} from '@/scripts/extract-url-from-mfm.js';
@ -344,6 +345,8 @@ function react(viaKeyboard = false): void {
pleaseLogin();
showMovedDialog();
if (appearNote.reactionAcceptance === 'likeOnly') {
sound.play('reaction');
if (props.mock) {
return;
}
@ -362,6 +365,8 @@ function react(viaKeyboard = false): void {
} else {
blur();
reactionPicker.show(reactButton.value, reaction => {
sound.play('reaction');
if (props.mock) {
emit('reaction', reaction);
return;

View file

@ -204,6 +204,7 @@ import { checkWordMute } from '@/scripts/check-word-mute.js';
import { userPage } from '@/filters/user.js';
import { notePage } from '@/filters/note.js';
import * as os from '@/os.js';
import * as sound from '@/scripts/sound.js';
import { defaultStore, noteViewInterruptors } from '@/store.js';
import { reactionPicker } from '@/scripts/reaction-picker.js';
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
@ -396,6 +397,8 @@ function react(viaKeyboard = false): void {
pleaseLogin();
showMovedDialog();
if (appearNote.reactionAcceptance === 'likeOnly') {
sound.play('reaction');
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: '❤️',
@ -410,6 +413,8 @@ function react(viaKeyboard = false): void {
} else {
blur();
reactionPicker.show(reactButton.value, reaction => {
sound.play('reaction');
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: reaction,

View file

@ -28,6 +28,7 @@ import MkReactionEffect from '@/components/MkReactionEffect.vue';
import { claimAchievement } from '@/scripts/achievements.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
import * as sound from '@/scripts/sound.js';
let gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
@ -61,6 +62,10 @@ async function toggleReaction() {
});
if (confirm.canceled) return;
if (oldReaction !== props.reaction) {
sound.play('reaction');
}
if (mock) {
emit('reactionToggled', props.reaction, (props.count - 1));
return;
@ -77,6 +82,8 @@ async function toggleReaction() {
}
});
} else {
sound.play('reaction');
if (mock) {
emit('reactionToggled', props.reaction, (props.count + 1));
return;