diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-05-06 08:15:17 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-05-06 08:15:17 +0900 |
| commit | 5dfbce7571d0ecb70a9be6610f7906b702700d25 (patch) | |
| tree | 10939a08571ba3d3e8942de926d099bd78f901d3 /packages/frontend/src | |
| parent | enhance: プロフィール設定「追加情報」の並び替え・削除... (diff) | |
| download | misskey-5dfbce7571d0ecb70a9be6610f7906b702700d25.tar.gz misskey-5dfbce7571d0ecb70a9be6610f7906b702700d25.tar.bz2 misskey-5dfbce7571d0ecb70a9be6610f7906b702700d25.zip | |
feat: チャンネルの削除
Resolve #7171
Resolve #9935
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/pages/channel-editor.vue | 20 | ||||
| -rw-r--r-- | packages/frontend/src/pages/channel.vue | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/packages/frontend/src/pages/channel-editor.vue b/packages/frontend/src/pages/channel-editor.vue index 488738f31c..4050c087da 100644 --- a/packages/frontend/src/pages/channel-editor.vue +++ b/packages/frontend/src/pages/channel-editor.vue @@ -46,8 +46,9 @@ </div> </MkFolder> - <div> + <div class="_buttons"> <MkButton primary @click="save()"><i class="ti ti-device-floppy"></i> {{ channelId ? i18n.ts.save : i18n.ts.create }}</MkButton> + <MkButton v-if="channelId" danger @click="archive()"><i class="ti ti-trash"></i> {{ i18n.ts.archive }}</MkButton> </div> </div> </MkSpacer> @@ -151,6 +152,23 @@ function save() { } } +async function archive() { + const { canceled } = await os.confirm({ + type: 'warning', + title: i18n.t('channelArchiveConfirmTitle', { name: name }), + text: i18n.ts.channelArchiveConfirmDescription, + }); + + if (canceled) return; + + os.api('channels/update', { + channelId: props.channelId, + isArchived: true, + }).then(() => { + os.success(); + }); +} + function setBannerImage(evt) { selectFile(evt.currentTarget ?? evt.target, null).then(file => { bannerId = file.id; diff --git a/packages/frontend/src/pages/channel.vue b/packages/frontend/src/pages/channel.vue index 30e18c32ba..0a2f66d4fc 100644 --- a/packages/frontend/src/pages/channel.vue +++ b/packages/frontend/src/pages/channel.vue @@ -28,6 +28,8 @@ </MkFoldableSection> </div> <div v-if="channel && tab === 'timeline'" class="_gaps"> + <MkInfo v-if="channel.isArchived" warn>{{ i18n.ts.thisChannelArchived }}</MkInfo> + <!-- スマホ・タブレットの場合、キーボードが表示されると投稿が見づらくなるので、デスクトップ場合のみ自動でフォーカスを当てる --> <MkPostForm v-if="$i && defaultStore.reactiveState.showFixedPostFormInChannel.value" :channel="channel" class="post-form _panel" fixed :autofocus="deviceKind === 'desktop'"/> @@ -77,6 +79,7 @@ import MkButton from '@/components/MkButton.vue'; import MkInput from '@/components/MkInput.vue'; import { defaultStore } from '@/store'; import MkNote from '@/components/MkNote.vue'; +import MkInfo from '@/components/MkInfo.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; const router = useRouter(); |