npm eslint --fix .
This commit is contained in:
parent
6bea363b9d
commit
2c2b84d31d
56 changed files with 294 additions and 295 deletions
|
@ -315,7 +315,7 @@ const exportFriends = ({ id, credentials }) => {
|
|||
let more = true
|
||||
while (more) {
|
||||
const maxId = friends.length > 0 ? last(friends).id : undefined
|
||||
const users = await fetchFriends({id, maxId, credentials})
|
||||
const users = await fetchFriends({ id, maxId, credentials })
|
||||
friends = concat(friends, users)
|
||||
if (users.length === 0) {
|
||||
more = false
|
||||
|
|
|
@ -59,7 +59,7 @@ const srgbToLinear = (srgb) => {
|
|||
* @returns {Number} relative luminance
|
||||
*/
|
||||
const relativeLuminance = (srgb) => {
|
||||
const {r, g, b} = srgbToLinear(srgb)
|
||||
const { r, g, b } = srgbToLinear(srgb)
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ export const wordAtPosition = (str, pos) => {
|
|||
const words = splitIntoWords(str)
|
||||
const wordsWithPosition = addPositionToWords(words)
|
||||
|
||||
return find(wordsWithPosition, ({start, end}) => start <= pos && end > pos)
|
||||
return find(wordsWithPosition, ({ start, end }) => start <= pos && end > pos)
|
||||
}
|
||||
|
||||
export const addPositionToWords = (words) => {
|
||||
|
|
|
@ -9,7 +9,7 @@ const fileSizeFormat = (num) => {
|
|||
exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1)
|
||||
num = (num / Math.pow(1024, exponent)).toFixed(2) * 1
|
||||
unit = units[exponent]
|
||||
return {num: num, unit: unit}
|
||||
return { num: num, unit: unit }
|
||||
}
|
||||
const fileSizeFormatService = {
|
||||
fileSizeFormat
|
||||
|
|
|
@ -8,7 +8,7 @@ const fetchAndUpdate = ({ store, credentials }) => {
|
|||
.catch(() => {})
|
||||
}
|
||||
|
||||
const startFetching = ({credentials, store}) => {
|
||||
const startFetching = ({ credentials, store }) => {
|
||||
fetchAndUpdate({ credentials, store })
|
||||
const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })
|
||||
return setInterval(boundFetchAndUpdate, 10000)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const verifyOTPCode = ({app, instance, mfaToken, code}) => {
|
||||
const verifyOTPCode = ({ app, instance, mfaToken, code }) => {
|
||||
const url = `${instance}/oauth/mfa/challenge`
|
||||
const form = new window.FormData()
|
||||
|
||||
|
@ -14,7 +14,7 @@ const verifyOTPCode = ({app, instance, mfaToken, code}) => {
|
|||
}).then((data) => data.json())
|
||||
}
|
||||
|
||||
const verifyRecoveryCode = ({app, instance, mfaToken, code}) => {
|
||||
const verifyRecoveryCode = ({ app, instance, mfaToken, code }) => {
|
||||
const url = `${instance}/oauth/mfa/challenge`
|
||||
const form = new window.FormData()
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ export const getClientToken = ({ clientId, clientSecret, instance }) => {
|
|||
body: form
|
||||
}).then((data) => data.json())
|
||||
}
|
||||
const verifyOTPCode = ({app, instance, mfaToken, code}) => {
|
||||
const verifyOTPCode = ({ app, instance, mfaToken, code }) => {
|
||||
const url = `${instance}/oauth/mfa/challenge`
|
||||
const form = new window.FormData()
|
||||
|
||||
|
@ -109,7 +109,7 @@ const verifyOTPCode = ({app, instance, mfaToken, code}) => {
|
|||
}).then((data) => data.json())
|
||||
}
|
||||
|
||||
const verifyRecoveryCode = ({app, instance, mfaToken, code}) => {
|
||||
const verifyRecoveryCode = ({ app, instance, mfaToken, code }) => {
|
||||
const url = `${instance}/oauth/mfa/challenge`
|
||||
const form = new window.FormData()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import utils from './utils.js'
|
||||
import { parseUser } from '../entity_normalizer/entity_normalizer.service.js'
|
||||
|
||||
const search = ({query, store}) => {
|
||||
const search = ({ query, store }) => {
|
||||
return utils.request({
|
||||
store,
|
||||
url: '/api/v1/accounts/search',
|
||||
|
@ -10,8 +10,8 @@ const search = ({query, store}) => {
|
|||
resolve: true
|
||||
}
|
||||
})
|
||||
.then((data) => data.json())
|
||||
.then((data) => data.map(parseUser))
|
||||
.then((data) => data.json())
|
||||
.then((data) => data.map(parseUser))
|
||||
}
|
||||
const UserSearch = {
|
||||
search
|
||||
|
|
|
@ -13,7 +13,7 @@ const headers = (store) => {
|
|||
}
|
||||
}
|
||||
|
||||
const request = ({method = 'GET', url, params, store}) => {
|
||||
const request = ({ method = 'GET', url, params, store }) => {
|
||||
const instance = store.state.instance.server
|
||||
let fullUrl = `${instance}${url}`
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ export const visibleNotificationsFromStore = (store, types) => {
|
|||
}
|
||||
|
||||
export const unseenNotificationsFromStore = store =>
|
||||
filter(visibleNotificationsFromStore(store), ({seen}) => !seen)
|
||||
filter(visibleNotificationsFromStore(store), ({ seen }) => !seen)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import apiService from '../api/api.service.js'
|
||||
|
||||
const update = ({store, notifications, older}) => {
|
||||
const update = ({ store, notifications, older }) => {
|
||||
store.dispatch('setNotificationsError', { value: false })
|
||||
|
||||
store.dispatch('addNewNotifications', { notifications, older })
|
||||
}
|
||||
|
||||
const fetchAndUpdate = ({store, credentials, older = false}) => {
|
||||
const fetchAndUpdate = ({ store, credentials, older = false }) => {
|
||||
const args = { credentials }
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.notifications
|
||||
|
@ -45,7 +45,7 @@ const fetchNotifications = ({ store, args, older }) => {
|
|||
.catch(() => store.dispatch('setNotificationsError', { value: true }))
|
||||
}
|
||||
|
||||
const startFetching = ({credentials, store}) => {
|
||||
const startFetching = ({ credentials, store }) => {
|
||||
fetchAndUpdate({ credentials, store })
|
||||
const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })
|
||||
// Initially there's set flag to silence all desktop notifications so
|
||||
|
|
|
@ -13,7 +13,7 @@ const postStatus = ({ store, status, spoilerText, visibility, sensitive, poll, m
|
|||
mediaIds,
|
||||
inReplyToStatusId,
|
||||
contentType,
|
||||
poll})
|
||||
poll })
|
||||
.then((data) => {
|
||||
if (!data.error) {
|
||||
store.dispatch('addNewStatuses', {
|
||||
|
|
|
@ -239,12 +239,12 @@ const generateColors = (input) => {
|
|||
})
|
||||
|
||||
const htmlColors = Object.entries(colors)
|
||||
.reduce((acc, [k, v]) => {
|
||||
if (!v) return acc
|
||||
acc.solid[k] = rgb2hex(v)
|
||||
acc.complete[k] = typeof v.a === 'undefined' ? rgb2hex(v) : rgb2rgba(v)
|
||||
return acc
|
||||
}, { complete: {}, solid: {} })
|
||||
.reduce((acc, [k, v]) => {
|
||||
if (!v) return acc
|
||||
acc.solid[k] = rgb2hex(v)
|
||||
acc.complete[k] = typeof v.a === 'undefined' ? rgb2hex(v) : rgb2rgba(v)
|
||||
return acc
|
||||
}, { complete: {}, solid: {} })
|
||||
return {
|
||||
rules: {
|
||||
colors: Object.entries(htmlColors.complete)
|
||||
|
|
|
@ -2,7 +2,7 @@ import { camelCase } from 'lodash'
|
|||
|
||||
import apiService from '../api/api.service.js'
|
||||
|
||||
const update = ({store, statuses, timeline, showImmediately, userId}) => {
|
||||
const update = ({ store, statuses, timeline, showImmediately, userId }) => {
|
||||
const ccTimeline = camelCase(timeline)
|
||||
|
||||
store.dispatch('setError', { value: false })
|
||||
|
@ -15,7 +15,7 @@ const update = ({store, statuses, timeline, showImmediately, userId}) => {
|
|||
})
|
||||
}
|
||||
|
||||
const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false, until}) => {
|
||||
const fetchAndUpdate = ({ store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false, until }) => {
|
||||
const args = { timeline, credentials }
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
|
||||
|
@ -40,17 +40,17 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
|
|||
if (!older && statuses.length >= 20 && !timelineData.loading && numStatusesBeforeFetch > 0) {
|
||||
store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
|
||||
}
|
||||
update({store, statuses, timeline, showImmediately, userId})
|
||||
update({ store, statuses, timeline, showImmediately, userId })
|
||||
return statuses
|
||||
}, () => store.dispatch('setError', { value: true }))
|
||||
}
|
||||
|
||||
const startFetching = ({timeline = 'friends', credentials, store, userId = false, tag = false}) => {
|
||||
const startFetching = ({ timeline = 'friends', credentials, store, userId = false, tag = false }) => {
|
||||
const rootState = store.rootState || store.state
|
||||
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
|
||||
const showImmediately = timelineData.visibleStatuses.length === 0
|
||||
timelineData.userId = userId
|
||||
fetchAndUpdate({timeline, credentials, store, showImmediately, userId, tag})
|
||||
fetchAndUpdate({ timeline, credentials, store, showImmediately, userId, tag })
|
||||
const boundFetchAndUpdate = () => fetchAndUpdate({ timeline, credentials, store, userId, tag })
|
||||
return setInterval(boundFetchAndUpdate, 10000)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { hex2rgb } from '../color_convert/color_convert.js'
|
||||
const highlightStyle = (prefs) => {
|
||||
if (prefs === undefined) return
|
||||
const {color, type} = prefs
|
||||
const { color, type } = prefs
|
||||
if (typeof color !== 'string') return
|
||||
const rgb = hex2rgb(color)
|
||||
if (rgb == null) return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue