From 07cb9dcb73ad05ad87c4dbcac1c67167bdba61a5 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Fri, 4 Nov 2022 21:39:52 +0900 Subject: [PATCH] refs #3730 Fix to set poll expire --- .../components/TimelineSpace/Modals/NewToot.vue | 9 ++++++++- .../components/TimelineSpace/Modals/NewToot/Poll.vue | 11 ++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue index 147444e0..17cce5bf 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue @@ -31,7 +31,8 @@ { + pollExpire.label = newExpire.label + pollExpire.value = newExpire.value + } + const toggleContentWarning = () => { const previousHeight = spoilerRef.value ? spoilerRef.value.offsetHeight : 0 enableResizing.value = false @@ -468,6 +474,7 @@ export default defineComponent({ openPoll, polls, pollExpire, + updatePollExpire, statusHeight, // DOM refs previewRef, diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue b/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue index 1d515664..eb570a45 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue @@ -9,7 +9,7 @@ {{ $t('modals.new_toot.poll.add_choice') }} - + @@ -36,6 +36,7 @@ export default defineComponent({ required: true } }, + emits: ['addPoll', 'removePoll', 'update:expire', 'update:polls'], setup(props, ctx) { const i18n = useI18next() const { expire, polls } = toRefs(props) @@ -76,9 +77,12 @@ export default defineComponent({ const removePoll = (id: number) => { ctx.emit('removePoll', id) } + const updateExpire = newExpire => { + ctx.emit('update:expire', newExpire) + } watch(expire, (newExpire, _old) => { - ctx.emit('update:expire', newExpire) + updateExpire(newExpire) }) watch( polls, @@ -93,7 +97,8 @@ export default defineComponent({ expire, expiresList, addPoll, - removePoll + removePoll, + updateExpire } } })