From e7f94de70c80e8a31f6bdb6f84d2a2eef9689f8d Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 19 Jan 2018 00:32:16 -0800 Subject: [PATCH] refactor --- routes/_components/Timeline.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/routes/_components/Timeline.html b/routes/_components/Timeline.html index c7c0c2f1..f16275dc 100644 --- a/routes/_components/Timeline.html +++ b/routes/_components/Timeline.html @@ -30,11 +30,12 @@ let instanceName = this.store.get('currentInstance') let instanceData = this.store.get('currentInstanceData') let online = this.get('online') + let timeline = this.get('timeline') let statuses = online ? - await getTimeline(instanceName, instanceData.access_token, this.get('timeline'), null, FETCH_LIMIT) : - await getTimelineFromDatabase(instanceName, this.get('timeline'), null, FETCH_LIMIT) + await getTimeline(instanceName, instanceData.access_token, timeline, null, FETCH_LIMIT) : + await getTimelineFromDatabase(instanceName, timeline, null, FETCH_LIMIT) if (online) { - insertStatusesIntoDatabase(instanceName, this.get('timeline'), statuses) + insertStatusesIntoDatabase(instanceName, timeline, statuses) } this.addStatuses(statuses) this.set({initialized: true}) @@ -73,11 +74,12 @@ let instanceName = this.store.get('currentInstance') let instanceData = this.store.get('currentInstanceData') let online = this.get('online') + let timeline = this.get('timeline') let newStatuses = online ? - await getTimeline(instanceName, instanceData.access_token, this.get('timeline'), lastStatusId, FETCH_LIMIT) : - await getTimelineFromDatabase(instanceName, this.get('timeline'), lastStatusId, FETCH_LIMIT) + await getTimeline(instanceName, instanceData.access_token, timeline, lastStatusId, FETCH_LIMIT) : + await getTimelineFromDatabase(instanceName, timeline, lastStatusId, FETCH_LIMIT) if (online) { - insertStatusesIntoDatabase(instanceName, this.get('timeline'), newStatuses) + insertStatusesIntoDatabase(instanceName, timeline, newStatuses) } let statuses = this.get('statuses') if (statuses) {