From 350eb489c22e6bac20de92284193a87af63c52a9 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 2 Nov 2020 15:46:49 +0200 Subject: add favicon badge for unread notifs --- src/components/notifications/notifications.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/components') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 4b479e13..49258563 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -6,6 +6,7 @@ import { filteredNotificationsFromStore, unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils.js' +import FaviconService from '../../services/favicon_service/favicon_service.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' @@ -75,8 +76,10 @@ const Notifications = { watch: { unseenCountTitle (count) { if (count > 0) { + FaviconService.drawFaviconBadge() this.$store.dispatch('setPageTitle', `(${count})`) } else { + FaviconService.clearFaviconBadge() this.$store.dispatch('setPageTitle', '') } } -- cgit v1.2.3-70-g09d2 From 553155fc490d289242a0e57efab8de2834278959 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 9 Nov 2020 14:42:16 +0200 Subject: prevent call to scroll if the value doesn't change because firefox is stupid --- src/components/post_status_form/post_status_form.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index de583269..6a4efc2c 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -533,10 +533,12 @@ const PostStatusForm = { const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0 const targetScroll = currentScroll + totalDelta - if (scrollerRef === window) { - scrollerRef.scroll(0, targetScroll) - } else { - scrollerRef.scrollTop = targetScroll + if (totalDelta >= 1) { + if (scrollerRef === window) { + scrollerRef.scroll(0, targetScroll) + } else { + scrollerRef.scrollTop = targetScroll + } } this.$refs['emoji-input'].resize() -- cgit v1.2.3-70-g09d2 From c1c207788a3599602888a9c5cadedd99561266af Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 9 Nov 2020 15:02:48 +0200 Subject: change method of fix to rounding --- src/components/post_status_form/post_status_form.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 6a4efc2c..3ff4a3c8 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -531,14 +531,12 @@ const PostStatusForm = { !(isFormBiggerThanScroller && this.$refs.textarea.selectionStart !== this.$refs.textarea.value.length) const totalDelta = shouldScrollToBottom ? bottomChangeDelta : 0 - const targetScroll = currentScroll + totalDelta + const targetScroll = Math.round(currentScroll + totalDelta) - if (totalDelta >= 1) { - if (scrollerRef === window) { - scrollerRef.scroll(0, targetScroll) - } else { - scrollerRef.scrollTop = targetScroll - } + if (scrollerRef === window) { + scrollerRef.scroll(0, targetScroll) + } else { + scrollerRef.scrollTop = targetScroll } this.$refs['emoji-input'].resize() -- cgit v1.2.3-70-g09d2 From d150dae5d156416351312f25b06de0013ee0a95d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 10 Nov 2020 12:52:54 +0200 Subject: fixes to timeline error handling --- src/components/timeline/timeline.js | 12 +++-------- src/components/timeline/timeline.vue | 24 ++-------------------- src/components/timeline_menu/timeline_menu.js | 5 ++--- src/i18n/en.json | 2 +- src/modules/statuses.js | 2 -- src/services/api/api.service.js | 2 +- .../timeline_fetcher/timeline_fetcher.service.js | 15 ++++++++++---- 7 files changed, 20 insertions(+), 42 deletions(-) (limited to 'src/components') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index cba46daf..665d195e 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -50,17 +50,10 @@ const Timeline = { TimelineMenu }, computed: { - timelineError () { - return this.$store.state.statuses.error - }, - errorData () { - return this.$store.state.statuses.errorData - }, newStatusCount () { return this.timeline.newStatusCount }, showLoadButton () { - if (this.timelineError || this.errorData) return false return this.timeline.newStatusCount > 0 || this.timeline.flushMarker !== 0 }, loadButtonString () { @@ -171,11 +164,12 @@ const Timeline = { userId: this.userId, tag: this.tag }).then(({ statuses }) => { - store.commit('setLoading', { timeline: this.timelineName, value: false }) if (statuses && statuses.length === 0) { this.bottomedOut = true } - }) + }).finally(() => + store.commit('setLoading', { timeline: this.timelineName, value: false }) + ) }, 1000, this), determineVisibleStatuses () { if (!this.$refs.timeline) return diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 04859852..d4da2a87 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -2,22 +2,8 @@
-
- {{ $t('timeline.error_fetching') }} -
-
- {{ errorData.statusText }} -
- - - -
- {{ $t('timeline.error_fetching') }} -