simplify offline mode

This commit is contained in:
Nolan Lawson 2018-01-20 13:01:33 -08:00
parent 692bfa8660
commit e0cc3ff6dd
1 changed files with 2 additions and 4 deletions

View File

@ -48,8 +48,7 @@
key: status.id key: status.id
})), })),
lastStatusId: (statuses) => statuses.length && statuses[statuses.length - 1].id, lastStatusId: (statuses) => statuses.length && statuses[statuses.length - 1].id,
label: (timeline, $currentInstance) => `${timelines[timeline].label} timeline for ${$currentInstance}`, label: (timeline, $currentInstance) => `${timelines[timeline].label} timeline for ${$currentInstance}`
anyStatusesAreStale: (statuses) => statuses.some(status => status.pinafore_stale)
}, },
store: () => store, store: () => store,
components: { components: {
@ -89,9 +88,8 @@
let instanceData = this.store.get('currentInstanceData') let instanceData = this.store.get('currentInstanceData')
let timeline = this.get('timeline') let timeline = this.get('timeline')
let lastStatusId = this.get('lastStatusId') let lastStatusId = this.get('lastStatusId')
let anyStatusesAreStale = this.get('anyStatusesAreStale')
let statuses let statuses
if (!online || anyStatusesAreStale) { // if we're in offline mode, stay in offline mode to avoid weirdness if (!online) {
statuses = await database.getTimeline(instanceName, timeline, lastStatusId, FETCH_LIMIT) statuses = await database.getTimeline(instanceName, timeline, lastStatusId, FETCH_LIMIT)
} else { } else {
try { try {