From 920bd05081903c52a2521da5ea86714dfc82b452 Mon Sep 17 00:00:00 2001 From: Exilat Date: Sat, 3 Aug 2019 13:55:05 +0000 Subject: [PATCH 01/42] Update for Interactions, new search, sticker picker, update copy. --- src/i18n/oc.json | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/i18n/oc.json b/src/i18n/oc.json index 6100a4d2..2b2bd88a 100644 --- a/src/i18n/oc.json +++ b/src/i18n/oc.json @@ -65,6 +65,7 @@ "timeline": "Flux d’actualitat", "twkn": "Lo malhum conegut", "user_search": "Cèrca d’utilizaires", + "search": "Cercar", "who_to_follow": "Qual seguir", "preferences": "Preferéncias" }, @@ -91,7 +92,15 @@ "expires_in": "Lo sondatge s’acabarà {0}", "expired": "Sondatge acabat {0}", "not_enough_options": "I a pas pro d’opcions" - }, + }, + "stickers": { + "add_sticker": "Add Sticker" + }, + "interactions": { + "favs_repeats": "Repeticions e favorits", + "follows": "Nòus seguidors", + "load_older": "Cargar d’interaccions anterioras" + }, "post_status": { "new_status": "Publicar d’estatuts novèls", "account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.", @@ -269,7 +278,7 @@ "streaming": "Activar lo cargament automatic dels novèls estatus en anar amont", "text": "Tèxte", "theme": "Tèma", - "theme_help_v2_1": "You can also override certain component's colors and opacity by toggling the checkbox, use \"Clear all\" button to clear all overrides.", + "theme_help_v2_1": "Podètz tanben remplaçar la color d’unes compausants en clicant la case, utilizatz lo boton \"O escafar tot\" per escafar totes las subrecargadas.", "theme_help_v2_2": "Icons underneath some entries are background/text contrast indicators, hover over for detailed info. Please keep in mind that when using transparency contrast indicators show the worst possible case.", "theme_help": "Emplegatz los còdis de color hex (#rrggbb) per personalizar vòstre tèma de color.", "tooltipRadius": "Astúcias/alèrtas", @@ -280,12 +289,12 @@ "true": "òc" }, "notifications": "Notificacions", - "notification_setting": "Receber las notificacions de :", + "notification_setting": "Recebre las notificacions de :", "notification_setting_follows": "Utilizaires que seguissètz", "notification_setting_non_follows": "Utilizaires que seguissètz pas", "notification_setting_followers": "Utilizaires que vos seguisson", "notification_setting_non_followers": "Utilizaires que vos seguisson pas", - "notification_mutes": "Per receber pas mai d’un utilizaire en particular, botatz-lo en silenci.", + "notification_mutes": "Per recebre pas mai d’un utilizaire en particular, botatz-lo en silenci.", "notification_blocks": "Blocar un utilizaire arrèsta totas las notificacions tan coma quitar de los seguir.", "enable_web_push_notifications": "Activar las notificacions web push", "style": { @@ -477,6 +486,8 @@ "per_day": "per jorn", "remote_follow": "Seguir a distància", "statuses": "Estatuts", + "subscribe": "S’abonar", + "unsubscribe": "Se desabonar", "unblock": "Desblocar", "unblock_progress": "Desblocatge...", "block_progress": "Blocatge...", @@ -532,5 +543,12 @@ "GiB": "Gio", "TiB": "Tio" } + }, + "search": { + "people": "Gent", + "hashtags": "Etiquetas", + "person_talking": "{count} persona ne parla", + "people_talking": "{count} personas ne parlan", + "no_results": "Cap de resultats" } } \ No newline at end of file From 39106dc5450d4a927848477764bed2e31fe435c4 Mon Sep 17 00:00:00 2001 From: Exilat Date: Sat, 3 Aug 2019 14:04:49 +0000 Subject: [PATCH 02/42] Update oc.json --- src/i18n/oc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/oc.json b/src/i18n/oc.json index 2b2bd88a..54f42294 100644 --- a/src/i18n/oc.json +++ b/src/i18n/oc.json @@ -94,7 +94,7 @@ "not_enough_options": "I a pas pro d’opcions" }, "stickers": { - "add_sticker": "Add Sticker" + "add_sticker": "Ajustar un pegasolet" }, "interactions": { "favs_repeats": "Repeticions e favorits", From 66a34b7ecf65ded39882b9e4e7df9bbd2067afc3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 4 Sep 2019 12:19:39 +0300 Subject: [PATCH 03/42] Properly detect thread-muted posts and set `with_muted` when fetching notifications --- src/components/status/status.js | 2 +- .../notifications_fetcher/notifications_fetcher.service.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 502d9583..d037f150 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -117,7 +117,7 @@ const Status = { return hits }, - muted () { return !this.unmuted && (this.status.user.muted || this.muteWordHits.length > 0) }, + muted () { return !this.unmuted && (this.status.muted || this.muteWordHits.length > 0) }, hideFilteredStatuses () { return typeof this.$store.state.config.hideFilteredStatuses === 'undefined' ? this.$store.state.instance.hideFilteredStatuses diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index f9ec3f6e..b6c4cf80 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -10,6 +10,11 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => { const args = { credentials } const rootState = store.rootState || store.state const timelineData = rootState.statuses.notifications + const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined' + ? rootState.instance.hideMutedPosts + : rootState.config.hideMutedPosts + + args['withMuted'] = !hideMutedPosts args['timeline'] = 'notifications' if (older) { From 1a5a7bbebf45e93dbd47a99bb4eb05a5be5979f1 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 4 Sep 2019 21:11:13 +0300 Subject: [PATCH 04/42] Set thread_muted for all statuses with the same conversation id on status mute/unmute --- src/components/extra_buttons/extra_buttons.vue | 4 ++-- src/components/status/status.js | 2 +- src/modules/statuses.js | 10 ++++++---- .../entity_normalizer/entity_normalizer.service.js | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index ed0f3aa4..6781a4f8 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -10,14 +10,14 @@
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 42516916..c380d2dc 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -26,6 +26,7 @@ timeline-name="user" :user-id="userId" :pinned-status-ids="user.pinnedStatusIds" + :force-unmute="true" />
Date: Fri, 13 Sep 2019 16:17:51 -0400 Subject: [PATCH 22/42] do not collapse muted user's posts on muted user's media timeline --- src/components/user_profile/user_profile.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index c380d2dc..f463eea5 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -70,6 +70,7 @@ timeline-name="media" :timeline="media" :user-id="userId" + :force-unmute="true" /> Date: Fri, 13 Sep 2019 16:55:17 -0400 Subject: [PATCH 23/42] do not change word based muting logic --- src/components/conversation/conversation.js | 2 +- src/components/conversation/conversation.vue | 2 +- src/components/status/status.js | 4 ++-- src/components/timeline/timeline.js | 2 +- src/components/timeline/timeline.vue | 4 ++-- src/components/user_profile/user_profile.vue | 5 +++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 44dc49bc..72ee9c39 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -43,7 +43,7 @@ const conversation = { 'collapsable', 'isPage', 'pinnedStatusIdsObject', - 'forceUnmute' + 'inProfile' ], created () { if (this.isPage) { diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index ba138189..0f1de55f 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -26,7 +26,7 @@ :in-conversation="isExpanded" :highlight="getHighlight()" :replies="getReplies(status.id)" - :force-unmute="forceUnmute" + :in-profile="inProfile" class="status-fadein panel-body" @goto="setHighlight" @toggleExpanded="toggleExpanded" diff --git a/src/components/status/status.js b/src/components/status/status.js index 474a0480..e8966f47 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -30,7 +30,7 @@ const Status = { 'noHeading', 'inlineExpanded', 'showPinned', - 'forceUnmute' + 'inProfile' ], data () { return { @@ -118,7 +118,7 @@ const Status = { return hits }, - muted () { return !this.forceUnmute && !this.unmuted && (this.status.user.muted || this.muteWordHits.length > 0) }, + muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || this.muteWordHits.length > 0) }, hideFilteredStatuses () { return typeof this.$store.state.config.hideFilteredStatuses === 'undefined' ? this.$store.state.instance.hideFilteredStatuses diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 3d5f9de8..0594576c 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -26,7 +26,7 @@ const Timeline = { 'embedded', 'count', 'pinnedStatusIds', - 'forceUnmute' + 'inProfile' ], data () { return { diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index b89f505a..f1d3903a 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -36,7 +36,7 @@ :status-id="statusId" :collapsable="true" :pinned-status-ids-object="pinnedStatusIdsObject" - :force-unmute="forceUnmute" + :in-profile="inProfile" />
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index f463eea5..14082e83 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -26,7 +26,7 @@ timeline-name="user" :user-id="userId" :pinned-status-ids="user.pinnedStatusIds" - :force-unmute="true" + :in-profile="true" />
From 6a3f2832565392526c648c070a2e1275c37f83ea Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 13 Sep 2019 22:59:24 -0400 Subject: [PATCH 24/42] detect thread-muted posts --- src/components/status/status.js | 2 +- src/services/entity_normalizer/entity_normalizer.service.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index e8966f47..1c38b0f1 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -118,7 +118,7 @@ const Status = { return hits }, - muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || this.muteWordHits.length > 0) }, + muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || this.status.thread_muted || this.muteWordHits.length > 0) }, hideFilteredStatuses () { return typeof this.$store.state.config.hideFilteredStatuses === 'undefined' ? this.$store.state.instance.hideFilteredStatuses diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 6cc1851d..7438cd90 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -224,6 +224,7 @@ export const parseStatus = (data) => { output.statusnet_conversation_id = data.pleroma.conversation_id output.is_local = pleroma.local output.in_reply_to_screen_name = data.pleroma.in_reply_to_account_acct + output.thread_muted = pleroma.thread_muted } else { output.text = data.content output.summary = data.spoiler_text From baebf08d20eed14d06f9253e4cc939891955f8cb Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 13 Sep 2019 22:59:45 -0400 Subject: [PATCH 25/42] do not collapse thread muted posts in conversation --- src/components/status/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 1c38b0f1..d17ba318 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -118,7 +118,7 @@ const Status = { return hits }, - muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || this.status.thread_muted || this.muteWordHits.length > 0) }, + muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) }, hideFilteredStatuses () { return typeof this.$store.state.config.hideFilteredStatuses === 'undefined' ? this.$store.state.instance.hideFilteredStatuses From 8618857aa36574f52a23106cd0d57fd96782435b Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 6 Sep 2019 11:15:22 -0400 Subject: [PATCH 26/42] collapse fav/repeat notifications from muted users --- src/components/notification/notification.js | 14 +- src/components/notification/notification.vue | 202 ++++++++++-------- .../notifications/notifications.scss | 5 +- 3 files changed, 128 insertions(+), 93 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 896c6d52..181f7715 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -9,7 +9,8 @@ const Notification = { data () { return { userExpanded: false, - betterShadow: this.$store.state.interface.browserSupport.cssFilter + betterShadow: this.$store.state.interface.browserSupport.cssFilter, + unmuted: false } }, props: [ 'notification' ], @@ -23,11 +24,14 @@ const Notification = { toggleUserExpanded () { this.userExpanded = !this.userExpanded }, - userProfileLink (user) { + generateUserProfileLink (user) { return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) }, getUser (notification) { return this.$store.state.users.usersObject[notification.from_profile.id] + }, + toggleMute () { + this.unmuted = !this.unmuted } }, computed: { @@ -47,6 +51,12 @@ const Notification = { return this.userInStore } return this.notification.from_profile + }, + userProfileLink () { + return this.generateUserProfileLink(this.notification.from_profile) + }, + needMute () { + return this.notification.from_profile.muted } } } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index bafcd026..1f192c77 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -4,104 +4,126 @@ :compact="true" :statusoid="notification.status" /> -
- +
- - -
- - -
- - - - {{ notification.from_profile.name }} - - - {{ $t('notifications.favorited_you') }} - - - + + {{ notification.from_profile.screen_name }} + + + +
+
+ + + +
+ + +
+ + - {{ $t('notifications.repeated_you') }} - - - - {{ $t('notifications.followed_you') }} - -
+ + {{ notification.from_profile.name }} + + + {{ $t('notifications.favorited_you') }} + + + + {{ $t('notifications.repeated_you') }} + + + + {{ $t('notifications.followed_you') }} + +
+
+ + + +
+
+ + + +
+ +
- - - -
-
- - + + @{{ notification.from_profile.screen_name }}
- - -
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 622d12f4..71876b14 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -33,7 +33,6 @@ .notification { box-sizing: border-box; - display: flex; border-bottom: 1px solid; border-color: $fallback--border; border-color: var(--border, $fallback--border); @@ -47,6 +46,10 @@ } } + .muted { + padding: .25em .6em; + } + .non-mention { display: flex; flex: 1; From f8139e369c0ca4ae90cca78c5d1fee69b88375d6 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 10 Sep 2019 16:21:52 -0400 Subject: [PATCH 27/42] wire up user state with global store --- src/components/notification/notification.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 181f7715..8e817f3b 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -53,10 +53,10 @@ const Notification = { return this.notification.from_profile }, userProfileLink () { - return this.generateUserProfileLink(this.notification.from_profile) + return this.generateUserProfileLink(this.user) }, needMute () { - return this.notification.from_profile.muted + return this.user.muted } } } From 5ff899b455e07e41eb1b89985177655279f8263f Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 17 Sep 2019 15:59:17 -0400 Subject: [PATCH 28/42] add mention button --- src/components/user_card/user_card.js | 3 +++ src/components/user_card/user_card.vue | 9 +++++++++ src/i18n/en.json | 1 + 3 files changed, 13 insertions(+) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index e3bd7697..d42be9fc 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -168,6 +168,9 @@ export default { } this.$store.dispatch('setMedia', [attachment]) this.$store.dispatch('setCurrent', attachment) + }, + mentionUser () { + } } } diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 0b83cf16..f25d16d3 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -188,6 +188,15 @@
+
+ +
+
Date: Thu, 19 Sep 2019 13:27:37 -0400 Subject: [PATCH 30/42] add new module and modal to post new status --- src/App.js | 4 +- src/App.vue | 1 + .../post_status_modal/post_status_modal.js | 25 +++++++++++ .../post_status_modal/post_status_modal.vue | 42 +++++++++++++++++++ src/components/user_card/user_card.js | 2 +- src/main.js | 4 +- src/modules/postStatus.js | 25 +++++++++++ 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 src/components/post_status_modal/post_status_modal.js create mode 100644 src/components/post_status_modal/post_status_modal.vue create mode 100644 src/modules/postStatus.js diff --git a/src/App.js b/src/App.js index e9cd5917..40f362d2 100644 --- a/src/App.js +++ b/src/App.js @@ -11,6 +11,7 @@ import SideDrawer from './components/side_drawer/side_drawer.vue' import MobilePostStatusModal from './components/mobile_post_status_modal/mobile_post_status_modal.vue' import MobileNav from './components/mobile_nav/mobile_nav.vue' import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue' +import PostStatusModal from './components/post_status_modal/post_status_modal.vue' import { windowWidth } from './services/window_utils/window_utils' export default { @@ -28,7 +29,8 @@ export default { SideDrawer, MobilePostStatusModal, MobileNav, - UserReportingModal + UserReportingModal, + PostStatusModal }, data: () => ({ mobileActivePanel: 'timeline', diff --git a/src/App.vue b/src/App.vue index 719e00a4..46d3ac42 100644 --- a/src/App.vue +++ b/src/App.vue @@ -109,6 +109,7 @@ /> +
diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js new file mode 100644 index 00000000..86a4e1d8 --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.js @@ -0,0 +1,25 @@ +import PostStatusForm from '../post_status_form/post_status_form.vue' + +const PostStatusModal = { + components: { + PostStatusForm + }, + computed: { + isLoggedIn () { + return !!this.$store.state.users.currentUser + }, + isOpen () { + return this.isLoggedIn && this.$store.state.postStatus.modalActivated + }, + params () { + return this.$store.state.postStatus.params + } + }, + methods: { + closeModal () { + this.$store.dispatch('closePostStatusModal') + } + } +} + +export default PostStatusModal diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue new file mode 100644 index 00000000..85a5401c --- /dev/null +++ b/src/components/post_status_modal/post_status_modal.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index d42be9fc..0c200ad1 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -170,7 +170,7 @@ export default { this.$store.dispatch('setCurrent', attachment) }, mentionUser () { - + this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user }) } } } diff --git a/src/main.js b/src/main.js index b3256e8e..a43d31e2 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,7 @@ import mediaViewerModule from './modules/media_viewer.js' import oauthTokensModule from './modules/oauth_tokens.js' import reportsModule from './modules/reports.js' import pollsModule from './modules/polls.js' +import postStatusModule from './modules/postStatus.js' import VueI18n from 'vue-i18n' @@ -76,7 +77,8 @@ const persistedStateOptions = { mediaViewer: mediaViewerModule, oauthTokens: oauthTokensModule, reports: reportsModule, - polls: pollsModule + polls: pollsModule, + postStatus: postStatusModule }, plugins: [persistedState, pushNotifications], strict: false // Socket modifies itself, let's ignore this for now. diff --git a/src/modules/postStatus.js b/src/modules/postStatus.js new file mode 100644 index 00000000..638c1fb2 --- /dev/null +++ b/src/modules/postStatus.js @@ -0,0 +1,25 @@ +const postStatus = { + state: { + params: null, + modalActivated: false + }, + mutations: { + openPostStatusModal (state, params) { + state.params = params + state.modalActivated = true + }, + closePostStatusModal (state) { + state.modalActivated = false + } + }, + actions: { + openPostStatusModal ({ commit }, params) { + commit('openPostStatusModal', params) + }, + closePostStatusModal ({ commit }) { + commit('closePostStatusModal') + } + } +} + +export default postStatus From a9f33272a860fd95def54c7dafa863056324122d Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 19 Sep 2019 13:52:20 -0400 Subject: [PATCH 31/42] refactor MobilePostStatusModal using new PostStatusModal --- .../mobile_post_status_modal.js | 21 ++--------- .../mobile_post_status_modal.vue | 36 +------------------ 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.js b/src/components/mobile_post_status_modal/mobile_post_status_modal.js index 3cec23c6..3be4a1d8 100644 --- a/src/components/mobile_post_status_modal/mobile_post_status_modal.js +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.js @@ -1,14 +1,9 @@ -import PostStatusForm from '../post_status_form/post_status_form.vue' import { debounce } from 'lodash' const MobilePostStatusModal = { - components: { - PostStatusForm - }, data () { return { hidden: false, - postFormOpen: false, scrollingDown: false, inputActive: false, oldScrollPos: 0, @@ -28,8 +23,8 @@ const MobilePostStatusModal = { window.removeEventListener('resize', this.handleOSK) }, computed: { - currentUser () { - return this.$store.state.users.currentUser + isLoggedIn () { + return !!this.$store.state.users.currentUser }, isHidden () { return this.autohideFloatingPostButton && (this.hidden || this.inputActive) @@ -57,17 +52,7 @@ const MobilePostStatusModal = { window.removeEventListener('scroll', this.handleScrollEnd) }, openPostForm () { - this.postFormOpen = true - this.hidden = true - - const el = this.$el.querySelector('textarea') - this.$nextTick(function () { - el.focus() - }) - }, - closePostForm () { - this.postFormOpen = false - this.hidden = false + this.$store.dispatch('openPostStatusModal') }, handleOSK () { // This is a big hack: we're guessing from changed window sizes if the diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue index b6d7d3ba..38c5fce0 100644 --- a/src/components/mobile_post_status_modal/mobile_post_status_modal.vue +++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.vue @@ -1,23 +1,5 @@ - +