diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json index d7fc184c..6d2b0ef2 100644 --- a/src/config/locales/en/translation.json +++ b/src/config/locales/en/translation.json @@ -223,7 +223,16 @@ "pined_hashtag": "Pin the hashtag" }, "poll": { - "add_choice": "Add a choice" + "add_choice": "Add a choice", + "expires": { + "5_minutes": "5 minutes", + "30_minutes": "30 minutes", + "1_hour": "1 hour", + "6_hours": "6 hours", + "1_day": "1 day", + "3_days": "3 days", + "7_days": "7 days" + } } }, "jump": { diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue index 71d6023c..a9812145 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue @@ -14,7 +14,14 @@ - +
@@ -142,7 +149,11 @@ export default { showContentWarning: false, visibilityList: Visibility, openPoll: false, - polls: ['', ''] + polls: ['', ''], + pollExpire: { + label: this.$t('modals.new_toot.poll.expires.1_day'), + value: 3600 * 24 + } } }, computed: { @@ -219,6 +230,10 @@ export default { close() { this.filteredAccount = [] this.polls = ['', ''] + this.pollExpire = { + label: this.$t('modals.new_toot.poll.expires.1_day'), + value: 3600 * 24 + } this.$store.dispatch('TimelineSpace/Modals/NewToot/resetMediaCount') this.$store.dispatch('TimelineSpace/Modals/NewToot/closeModal') }, @@ -226,7 +241,8 @@ export default { const form = { status: this.status, spoiler: this.spoiler, - polls: this.polls + polls: this.polls, + pollExpireSeconds: this.pollExpire.value } try { @@ -344,6 +360,9 @@ export default { }, removePoll(id) { this.polls.splice(id, 1) + }, + changeExpire(obj) { + this.pollExpire = obj } } } diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue b/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue index 11114266..c606620d 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot/Poll.vue @@ -9,13 +9,54 @@ {{ $t('modals.new_toot.poll.add_choice') }} + + +