From 20e4c6b01e79fd8938b756d939540ac05b5fe1a0 Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Sat, 16 Dec 2023 12:57:53 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E3=81=A7=E3=81=A9=E3=81=93=E3=81=8B=E3=82=89=E3=81=A7?= =?UTF-8?q?=E3=82=82=E3=83=81=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E3=81=AB?= =?UTF-8?q?=E6=8A=95=E3=81=92=E3=82=89=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/MkPostForm.vue | 35 ++++++++++--------- .../src/components/MkVisibilityPicker.vue | 32 +++++++++++++++++ 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 4a1930ac0b..a5ea648277 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -19,20 +19,20 @@ SPDX-License-Identifier: AGPL-3.0-only
- @@ -46,6 +51,7 @@ import { nextTick, shallowRef, ref } from 'vue'; import * as Misskey from 'misskey-js'; import MkModal from '@/components/MkModal.vue'; import { i18n } from '@/i18n.js'; +import * as os from "@/os.js"; const modal = shallowRef>(); @@ -64,6 +70,32 @@ const emit = defineEmits<{ const v = ref(props.currentVisibility); +/** + * Visibility とチャンネルはそれぞれ独立だけど、今のところはチャンネル投稿は連合なしだし公開範囲も変更できないようである + + packages/frontend/src/components/MkPostForm.vue :475 + if (props.channel) { + visibility.value = 'public'; + localOnly.value = true; // TODO: チャンネルが連合するようになった折には消す + return; + } + + */ +const channels = ref([]); +async function getChannel(){ + const res = await os.api('channels/my-favorites', { + limit: 100, + }); + channels.value.splice(0, 0, ...res); +} +getChannel(); + +async function chooseChannel(channel: string ){ + emit("changeChannel", channel); + await nextTick(); + if (modal.value) modal.value.close(); +} + function choose(visibility: typeof Misskey.noteVisibilities[number]): void { v.value = visibility; emit('changeVisibility', visibility);