Apply suggestions from code review

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
Kainoa Kanter 2022-07-15 07:23:23 -07:00 committed by GitHub
parent a61da5e486
commit 87b38c651f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -109,6 +109,5 @@
"eslint-plugin-import": "2.26.0", "eslint-plugin-import": "2.26.0",
"eslint-plugin-vue": "9.2.0", "eslint-plugin-vue": "9.2.0",
"start-server-and-test": "1.14.0" "start-server-and-test": "1.14.0"
}, }
"packageManager": "yarn@3.2.1"
} }

View File

@ -7,7 +7,6 @@
</div> </div>
<div v-else-if="media.type.startsWith('audio') && media.type !== 'audio/midi'" class="audio"> <div v-else-if="media.type.startsWith('audio') && media.type !== 'audio/midi'" class="audio">
<audio <audio
id="player"
ref="audioEl" ref="audioEl"
class="audio vlite-js" class="audio vlite-js"
:src="media.url" :src="media.url"
@ -49,7 +48,7 @@ function volumechange() {
onMounted(() => { onMounted(() => {
if (audioEl) { if (audioEl) {
audioEl.volume = ColdDeviceStorage.get('mediaVolume'); audioEl.volume = ColdDeviceStorage.get('mediaVolume');
new Vlitejs('#player'); new Vlitejs(audioEl);
} }
}); });
</script> </script>

View File

@ -7,7 +7,6 @@
</div> </div>
<div v-else class="kkjnbbplepmiyuadieoenjgutgcmtsvu"> <div v-else class="kkjnbbplepmiyuadieoenjgutgcmtsvu">
<video <video
id="player"
ref="videoEl" ref="videoEl"
:poster="video.thumbnailUrl" :poster="video.thumbnailUrl"
:title="video.comment" :title="video.comment"
@ -34,8 +33,10 @@ const props = defineProps<{
video: misskey.entities.DriveFile; video: misskey.entities.DriveFile;
}>(); }>();
const videoEl = $ref(null);
onMounted(() => { onMounted(() => {
new Vlitejs('#player'); new Vlitejs(videoEl);
}); });
const hide = ref((defaultStore.state.nsfw === 'force') ? true : props.video.isSensitive && (defaultStore.state.nsfw !== 'ignore')); const hide = ref((defaultStore.state.nsfw === 'force') ? true : props.video.isSensitive && (defaultStore.state.nsfw !== 'ignore'));