From 51e6f891ac325554a17c4fe304f0adf475f34b2c Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 11 Apr 2018 23:12:51 +0900 Subject: [PATCH] refs #199 Change visibility in new toot --- .../TimelineSpace/Modals/NewToot.vue | 31 ++++++++++++++----- .../store/TimelineSpace/Modals/NewToot.js | 6 +++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue index 5bd5c598ce..ff608405de 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue @@ -21,13 +21,13 @@
- - + + - Public - Unlisted - Private - Direct + Public + Unlisted + Private + Direct
@@ -59,7 +59,21 @@ export default { } }, attachedMedias: state => state.TimelineSpace.Modals.NewToot.attachedMedias, - blockSubmit: state => state.TimelineSpace.Modals.NewToot.blockSubmit + blockSubmit: state => state.TimelineSpace.Modals.NewToot.blockSubmit, + visibilityIcon: (state) => { + switch (state.TimelineSpace.Modals.NewToot.visibility) { + case 'public': + return 'globe' + case 'unlisted': + return 'unlock' + case 'private': + return 'lock' + case 'direct': + return 'envelope' + default: + return 'globe' + } + } }), newTootModal: { get () { @@ -171,6 +185,9 @@ export default { }, resetImage () { ++this.attachedImageId + }, + changeVisibility (level) { + this.$store.commit('TimelineSpace/Modals/NewToot/changeVisibility', level) } } } diff --git a/src/renderer/store/TimelineSpace/Modals/NewToot.js b/src/renderer/store/TimelineSpace/Modals/NewToot.js index 0b3ca82171..03572138cf 100644 --- a/src/renderer/store/TimelineSpace/Modals/NewToot.js +++ b/src/renderer/store/TimelineSpace/Modals/NewToot.js @@ -9,7 +9,8 @@ const NewToot = { status: '', replyToMessage: null, blockSubmit: false, - attachedMedias: [] + attachedMedias: [], + visibility: 'public' }, mutations: { changeModal (state, value) { @@ -32,6 +33,9 @@ const NewToot = { }, removeMedia (state, media) { state.attachedMedias = state.attachedMedias.filter(m => m.id !== media.id) + }, + changeVisibility (state, value) { + state.visibility = value } }, actions: {