fix(frontend): ユーザープロフィールページでセンシティブなメディアが隠されない問題を修正

This commit is contained in:
syuilo 2023-10-10 19:49:25 +09:00
parent 085bcf24da
commit 51b6a012a5
1 changed files with 18 additions and 9 deletions

View File

@ -10,15 +10,18 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.root"> <div :class="$style.root">
<MkLoading v-if="fetching"/> <MkLoading v-if="fetching"/>
<div v-if="!fetching && files.length > 0" :class="$style.stream"> <div v-if="!fetching && files.length > 0" :class="$style.stream">
<MkA <template v-for="file in files" :key="file.note.id + file.file.id">
v-for="file in files" <div v-if="file.file.isSensitive && !showingFiles.includes(file.file.id)" :class="$style.sensitive" @click="showingFiles.push(file.file.id)">
:key="file.note.id + file.file.id" <div>
:class="$style.img" <div><i class="ti ti-eye-exclamation"></i> {{ i18n.ts.sensitive }}</div>
:to="notePage(file.note)" <div>{{ i18n.ts.clickToShow }}</div>
> </div>
<!-- TODO: 画像以外のファイルに対応 --> </div>
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/> <MkA v-else :class="$style.img" :to="notePage(file.note)">
</MkA> <!-- TODO: 画像以外のファイルに対応 -->
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/>
</MkA>
</template>
</div> </div>
<p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p> <p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p>
</div> </div>
@ -45,6 +48,7 @@ let files = $ref<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
file: Misskey.entities.DriveFile; file: Misskey.entities.DriveFile;
}[]>([]); }[]>([]);
let showingFiles = $ref<string[]>([]);
function thumbnail(image: Misskey.entities.DriveFile): string { function thumbnail(image: Misskey.entities.DriveFile): string {
return defaultStore.state.disableShowingAnimatedImages return defaultStore.state.disableShowingAnimatedImages
@ -94,4 +98,9 @@ onMounted(() => {
padding: 16px; padding: 16px;
text-align: center; text-align: center;
} }
.sensitive {
display: grid;
place-items: center;
}
</style> </style>