From 507fe7905052e2dc5e9bf3e1ee3caee5239e353b Mon Sep 17 00:00:00 2001
From: shpuld <shpuld@gmail.com>
Date: Thu, 9 Mar 2017 01:13:37 +0200
Subject: Add base03 border to timeline bottom fetcher too.

---
 src/components/timeline/timeline.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/timeline/timeline.vue')

diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index ac074f3c..2b240faa 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -18,9 +18,9 @@
       <div class="timeline">
         <status-or-conversation v-for="status in timeline.visibleStatuses" :key="status.id" v-bind:statusoid="status"></status-or-conversation>
         <a href="#" v-on:click.prevent='fetchOlderStatuses()' v-if="!timeline.loading">
-          <div class="base01-background base05-border new-status-notification text-center">Load older statuses.</div>
+          <div class="base01-background base03-border new-status-notification text-center">Load older statuses.</div>
         </a>
-          <div class="base01-background base05-border new-status-notification text-center" v-else>...</div>
+          <div class="base01-background base03-border new-status-notification text-center" v-else>...</div>
       </div>
     </div>
   </div>
-- 
cgit v1.2.3-70-g09d2


From e064d2da4de67ad42268f8eea0efd20646b3cb16 Mon Sep 17 00:00:00 2001
From: wakarimasen <wakarimasen@airmail.cc>
Date: Thu, 9 Mar 2017 13:38:32 +0100
Subject: Use one error variable for all timelines

---
 src/components/timeline/timeline.js                 |  3 +++
 src/components/timeline/timeline.vue                |  6 +++---
 src/modules/statuses.js                             | 21 +++++++++------------
 .../timeline_fetcher/timeline_fetcher.service.js    | 13 ++-----------
 4 files changed, 17 insertions(+), 26 deletions(-)

(limited to 'src/components/timeline/timeline.vue')

diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index b4e80fe1..d5a9adcc 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -8,6 +8,9 @@ const Timeline = {
     'timelineName',
     'title'
   ],
+  computed: {
+    timelineError () { return this.$store.state.statuses.error }
+  },
   components: {
     Status,
     StatusOrConversation
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index ac074f3c..b1ff327b 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -4,13 +4,13 @@
       <div class="title">
         {{title}}
       </div>
-      <button @click.prevent="showNewStatuses" class="base06 base02-background loadmore-button" v-if="timeline.newStatusCount > 0 && !timeline.error">
+      <button @click.prevent="showNewStatuses" class="base06 base02-background loadmore-button" v-if="timeline.newStatusCount > 0 && !timelineError">
         Show new ({{timeline.newStatusCount}})
       </button>
-      <button @click.prevent class="base06 error no-press loadmore-button" v-if="timeline.error">
+      <button @click.prevent class="base06 error no-press loadmore-button" v-if="timelineError">
           Error fetching updates
       </button>
-      <button @click.prevent class="base04 base01-background no-press loadmore-button" v-if="!timeline.newStatusCount > 0 && !timeline.error">
+      <button @click.prevent class="base04 base01-background no-press loadmore-button" v-if="!timeline.newStatusCount > 0 && !timelineError">
         Up-to-date
       </button>
     </div>
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index e4528520..051ec71b 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -8,6 +8,7 @@ export const defaultState = {
   maxId: 0,
   notifications: [],
   favorites: new Set(),
+  error: false,
   timelines: {
     mentions: {
       statuses: [],
@@ -18,8 +19,7 @@ export const defaultState = {
       newStatusCount: 0,
       maxId: 0,
       minVisibleId: 0,
-      loading: false,
-      error: false
+      loading: false
     },
     public: {
       statuses: [],
@@ -30,8 +30,7 @@ export const defaultState = {
       newStatusCount: 0,
       maxId: 0,
       minVisibleId: 0,
-      loading: false,
-      error: false
+      loading: false
     },
     publicAndExternal: {
       statuses: [],
@@ -42,8 +41,7 @@ export const defaultState = {
       newStatusCount: 0,
       maxId: 0,
       minVisibleId: 0,
-      loading: false,
-      error: false
+      loading: false
     },
     friends: {
       statuses: [],
@@ -54,8 +52,7 @@ export const defaultState = {
       newStatusCount: 0,
       maxId: 0,
       minVisibleId: 0,
-      loading: false,
-      error: false
+      loading: false
     }
   }
 }
@@ -298,8 +295,8 @@ export const mutations = {
     const newStatus = state.allStatusesObject[id]
     newStatus.nsfw = nsfw
   },
-  setError (state, { timeline, value }) {
-    state.timelines[timeline].error = value
+  setError (state, { value }) {
+    state.error = value
   },
   markNotificationsAsSeen (state, notifications) {
     each(notifications, (notification) => {
@@ -314,8 +311,8 @@ const statuses = {
     addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false }) {
       commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser })
     },
-    setError ({ rootState, commit }, { timeline, value }) {
-      commit('setError', { timeline, value })
+    setError ({ rootState, commit }, { value }) {
+      commit('setError', { value })
     },
     deleteStatus ({ rootState, commit }, status) {
       commit('setDeleted', { status })
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js
index e684a170..24aef069 100644
--- a/src/services/timeline_fetcher/timeline_fetcher.service.js
+++ b/src/services/timeline_fetcher/timeline_fetcher.service.js
@@ -5,7 +5,7 @@ import apiService from '../api/api.service.js'
 const update = ({store, statuses, timeline, showImmediately}) => {
   const ccTimeline = camelCase(timeline)
 
-  setError({store, timeline, value: false})
+  store.dispatch('setError', { value: false })
 
   store.dispatch('addNewStatuses', {
     timeline: ccTimeline,
@@ -14,15 +14,6 @@ const update = ({store, statuses, timeline, showImmediately}) => {
   })
 }
 
-const setError = ({store, timeline, value}) => {
-  const ccTimeline = camelCase(timeline)
-
-  store.dispatch('setError', {
-    timeline: ccTimeline,
-    value
-  })
-}
-
 const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false}) => {
   const args = { timeline, credentials }
   const rootState = store.rootState || store.state
@@ -36,7 +27,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
 
   return apiService.fetchTimeline(args)
     .then((statuses) => update({store, statuses, timeline, showImmediately}),
-      () => setError({store, timeline, value: true}))
+      () => store.dispatch('setError', { value: true }))
 }
 
 const startFetching = ({ timeline = 'friends', credentials, store }) => {
-- 
cgit v1.2.3-70-g09d2

