From f6bba5f38f04a36906958cffeef9c3336be0e7b2 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 22 Jan 2023 01:35:42 +0900 Subject: [PATCH] refs #3771 Specify visibility --- .../components/TimelineSpace/Compose.vue | 66 +++++++++++++++++-- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/TimelineSpace/Compose.vue b/src/renderer/components/TimelineSpace/Compose.vue index fd9a3892..9409c768 100644 --- a/src/renderer/components/TimelineSpace/Compose.vue +++ b/src/renderer/components/TimelineSpace/Compose.vue @@ -24,9 +24,33 @@ - - - +
+ + + + + + +
parseInt(route.params.id as string)) const userAgent = computed(() => store.state.App.userAgent) + const visibilityIcon = computed(() => { + switch (visibility.value) { + case visibilityList.Public.key: + return 'globe' + case visibilityList.Unlisted.key: + return 'unlock' + case visibilityList.Private.key: + return 'lock' + case visibilityList.Direct.key: + return 'envelope' + default: + return 'globe' + } + }) + const emojiData = ref(null) const client = ref(null) const form = reactive({ @@ -85,6 +125,7 @@ export default defineComponent({ }) const attachments = ref>([]) const cw = ref(false) + const visibility = ref(visibilityList.Public.key) const loading = ref(false) const emojiVisible = ref(false) const imageRef = ref(null) @@ -121,7 +162,9 @@ export default defineComponent({ if (!client.value) { return } - let options = {} + let options = { + visibility: visibility.value + } try { loading.value = true if (attachments.value.length > 0) { @@ -197,6 +240,10 @@ export default defineComponent({ emojiVisible.value = false } + const changeVisibility = (value: 'public' | 'unlisted' | 'private' | 'direct') => { + visibility.value = value + } + return { form, post, @@ -210,7 +257,10 @@ export default defineComponent({ selectEmoji, statusRef, emojiVisible, - cw + cw, + visibilityList, + visibilityIcon, + changeVisibility } } }) @@ -291,6 +341,8 @@ export default defineComponent({ margin-top: 4px; .tool-buttons { + display: flex; + button { margin-right: 8px; } @@ -308,6 +360,10 @@ export default defineComponent({ } } } + +.privacy-icon { + margin-right: 4px; +}