parent
3a105024c7
commit
5dfbce7571
13 changed files with 60 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue