lint fixes
This commit is contained in:
parent
64350ad912
commit
8dcf72d144
|
@ -67,8 +67,7 @@ export async function updateVerifyCredentialsForInstance (instanceName) {
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
export async function updateInstanceInfo(instanceName) {
|
||||
export async function updateInstanceInfo (instanceName) {
|
||||
await cacheFirstUpdateAfter(
|
||||
() => getInstanceInfo(instanceName),
|
||||
() => database.getInstanceInfo(instanceName),
|
||||
|
@ -79,4 +78,4 @@ export async function updateInstanceInfo(instanceName) {
|
|||
store.set({instanceInfos: instanceInfos})
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { cacheFirstUpdateAfter } from '../_utils/sync'
|
|||
import { getPinnedStatuses } from '../_api/pinnedStatuses'
|
||||
import { database } from '../_database/database'
|
||||
|
||||
export async function updatePinnedStatusesForAccount(accountId) {
|
||||
export async function updatePinnedStatusesForAccount (accountId) {
|
||||
let instanceName = store.get('currentInstance')
|
||||
let accessToken = store.get('accessToken')
|
||||
|
||||
|
@ -18,6 +18,4 @@ export async function updatePinnedStatusesForAccount(accountId) {
|
|||
store.set({pinnedStatuses: $pinnedStatuses})
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { store } from '../_store/store'
|
|||
import { toast } from '../_utils/toast'
|
||||
import { search } from '../_api/search'
|
||||
|
||||
export async function doSearch() {
|
||||
export async function doSearch () {
|
||||
let instanceName = store.get('currentInstance')
|
||||
let accessToken = store.get('accessToken')
|
||||
let queryInSearch = store.get('queryInSearch')
|
||||
|
@ -22,4 +22,4 @@ export async function doSearch() {
|
|||
} finally {
|
||||
store.set({searchLoading: false})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,8 +50,8 @@ function handleStreamMessage (instanceName, timelineName, message) {
|
|||
}
|
||||
|
||||
export function createStream (streamingApi, instanceName, accessToken, timelineName) {
|
||||
new TimelineStream(streamingApi, accessToken, timelineName, {
|
||||
onMessage(msg) {
|
||||
return new TimelineStream(streamingApi, accessToken, timelineName, {
|
||||
onMessage (msg) {
|
||||
console.log('message', msg)
|
||||
if (msg.event !== 'update' && msg.event !== 'delete') {
|
||||
console.error("don't know how to handle event", msg)
|
||||
|
@ -61,14 +61,14 @@ export function createStream (streamingApi, instanceName, accessToken, timelineN
|
|||
handleStreamMessage(instanceName, timelineName, msg)
|
||||
})
|
||||
},
|
||||
onOpen() {
|
||||
onOpen () {
|
||||
console.log('opened stream for timeline', timelineName)
|
||||
},
|
||||
onClose() {
|
||||
onClose () {
|
||||
console.log('closed stream for timeline', timelineName)
|
||||
},
|
||||
onReconnect() {
|
||||
onReconnect () {
|
||||
console.log('reconnected stream for timeline', timelineName)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ function cloneForStorage (obj) {
|
|||
return res
|
||||
}
|
||||
|
||||
function cacheStatus(status, instanceName) {
|
||||
function cacheStatus (status, instanceName) {
|
||||
setInCache(statusesCache, instanceName, status.id, status)
|
||||
setInCache(accountsCache, instanceName, status.account.id, status.account)
|
||||
if (status.reblog) {
|
||||
|
@ -318,4 +318,4 @@ export async function getPinnedStatuses (instanceName, accountId) {
|
|||
callback(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,4 @@ export function instanceObservers (store) {
|
|||
updateInstanceInfo(currentInstance)
|
||||
updateLists()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ import { updateInstanceInfo } from '../_actions/instances'
|
|||
import { createStream } from '../_actions/streaming'
|
||||
|
||||
export function timelineObservers (store) {
|
||||
|
||||
let currentTimelineStream
|
||||
|
||||
store.observe('currentTimeline', async (currentTimeline) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const TIMEOUT = 15000
|
||||
|
||||
function fetchWithTimeout(url, options) {
|
||||
function fetchWithTimeout (url, options) {
|
||||
return Promise.race([
|
||||
fetch(url, options),
|
||||
new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Reference in New Issue