lint fixes

This commit is contained in:
Nolan Lawson 2018-02-11 14:11:03 -08:00
parent 64350ad912
commit 8dcf72d144
8 changed files with 16 additions and 20 deletions

View file

@ -67,8 +67,7 @@ export async function updateVerifyCredentialsForInstance (instanceName) {
) )
} }
export async function updateInstanceInfo (instanceName) {
export async function updateInstanceInfo(instanceName) {
await cacheFirstUpdateAfter( await cacheFirstUpdateAfter(
() => getInstanceInfo(instanceName), () => getInstanceInfo(instanceName),
() => database.getInstanceInfo(instanceName), () => database.getInstanceInfo(instanceName),

View file

@ -3,7 +3,7 @@ import { cacheFirstUpdateAfter } from '../_utils/sync'
import { getPinnedStatuses } from '../_api/pinnedStatuses' import { getPinnedStatuses } from '../_api/pinnedStatuses'
import { database } from '../_database/database' import { database } from '../_database/database'
export async function updatePinnedStatusesForAccount(accountId) { export async function updatePinnedStatusesForAccount (accountId) {
let instanceName = store.get('currentInstance') let instanceName = store.get('currentInstance')
let accessToken = store.get('accessToken') let accessToken = store.get('accessToken')
@ -18,6 +18,4 @@ export async function updatePinnedStatusesForAccount(accountId) {
store.set({pinnedStatuses: $pinnedStatuses}) store.set({pinnedStatuses: $pinnedStatuses})
} }
) )
} }

View file

@ -2,7 +2,7 @@ import { store } from '../_store/store'
import { toast } from '../_utils/toast' import { toast } from '../_utils/toast'
import { search } from '../_api/search' import { search } from '../_api/search'
export async function doSearch() { export async function doSearch () {
let instanceName = store.get('currentInstance') let instanceName = store.get('currentInstance')
let accessToken = store.get('accessToken') let accessToken = store.get('accessToken')
let queryInSearch = store.get('queryInSearch') let queryInSearch = store.get('queryInSearch')

View file

@ -50,8 +50,8 @@ function handleStreamMessage (instanceName, timelineName, message) {
} }
export function createStream (streamingApi, instanceName, accessToken, timelineName) { export function createStream (streamingApi, instanceName, accessToken, timelineName) {
new TimelineStream(streamingApi, accessToken, timelineName, { return new TimelineStream(streamingApi, accessToken, timelineName, {
onMessage(msg) { onMessage (msg) {
console.log('message', msg) console.log('message', msg)
if (msg.event !== 'update' && msg.event !== 'delete') { if (msg.event !== 'update' && msg.event !== 'delete') {
console.error("don't know how to handle event", msg) console.error("don't know how to handle event", msg)
@ -61,13 +61,13 @@ export function createStream (streamingApi, instanceName, accessToken, timelineN
handleStreamMessage(instanceName, timelineName, msg) handleStreamMessage(instanceName, timelineName, msg)
}) })
}, },
onOpen() { onOpen () {
console.log('opened stream for timeline', timelineName) console.log('opened stream for timeline', timelineName)
}, },
onClose() { onClose () {
console.log('closed stream for timeline', timelineName) console.log('closed stream for timeline', timelineName)
}, },
onReconnect() { onReconnect () {
console.log('reconnected stream for timeline', timelineName) console.log('reconnected stream for timeline', timelineName)
} }
}) })

View file

@ -57,7 +57,7 @@ function cloneForStorage (obj) {
return res return res
} }
function cacheStatus(status, instanceName) { function cacheStatus (status, instanceName) {
setInCache(statusesCache, instanceName, status.id, status) setInCache(statusesCache, instanceName, status.id, status)
setInCache(accountsCache, instanceName, status.account.id, status.account) setInCache(accountsCache, instanceName, status.account.id, status.account)
if (status.reblog) { if (status.reblog) {

View file

@ -2,7 +2,6 @@ import { updateInstanceInfo } from '../_actions/instances'
import { createStream } from '../_actions/streaming' import { createStream } from '../_actions/streaming'
export function timelineObservers (store) { export function timelineObservers (store) {
let currentTimelineStream let currentTimelineStream
store.observe('currentTimeline', async (currentTimeline) => { store.observe('currentTimeline', async (currentTimeline) => {

View file

@ -1,6 +1,6 @@
const TIMEOUT = 15000 const TIMEOUT = 15000
function fetchWithTimeout(url, options) { function fetchWithTimeout (url, options) {
return Promise.race([ return Promise.race([
fetch(url, options), fetch(url, options),
new Promise((resolve, reject) => { new Promise((resolve, reject) => {