feat(frontend/channel-editor): support isSensitive in create/edit channel page

This commit is contained in:
anatawa12 2023-07-31 15:40:16 +09:00
parent 11593a76b0
commit fb91b8cb95
No known key found for this signature in database
GPG Key ID: 9CA909848B8E4EA6
1 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,10 @@
<template #label>{{ i18n.ts.color }}</template>
</MkColorInput>
<MkSwitch v-model="isSensitive">
<template #label>{{ i18n.ts.sensitive }}</template>
</MkSwitch>
<div>
<MkButton v-if="bannerId == null" @click="setBannerImage"><i class="ti ti-plus"></i> {{ i18n.ts._channel.setBanner }}</MkButton>
<div v-else-if="bannerUrl">
@ -67,6 +71,7 @@ import { useRouter } from '@/router';
import { definePageMetadata } from '@/scripts/page-metadata';
import { i18n } from '@/i18n';
import MkFolder from '@/components/MkFolder.vue';
import MkSwitch from "@/components/MkSwitch.vue";
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
@ -82,6 +87,7 @@ let description = $ref(null);
let bannerUrl = $ref<string | null>(null);
let bannerId = $ref<string | null>(null);
let color = $ref('#000');
let isSensitive = $ref(false);
const pinnedNotes = ref([]);
watch(() => bannerId, async () => {
@ -105,6 +111,7 @@ async function fetchChannel() {
description = channel.description;
bannerId = channel.bannerId;
bannerUrl = channel.bannerUrl;
isSensitive = channel.isSensitive;
pinnedNotes.value = channel.pinnedNoteIds.map(id => ({
id,
}));
@ -137,6 +144,7 @@ function save() {
bannerId: bannerId,
pinnedNoteIds: pinnedNotes.value.map(x => x.id),
color: color,
isSensitive: isSensitive,
};
if (props.channelId) {