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-vue": "9.2.0",
"start-server-and-test": "1.14.0"
},
"packageManager": "yarn@3.2.1"
}
}

View File

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

View File

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