Update standard to the latest version 🚀 (#519)

* chore(package): update standard to version 12.0.0

* package lock update

* fix eslint
This commit is contained in:
greenkeeper[bot] 2018-08-29 21:42:57 -07:00 committed by Nolan Lawson
parent d599f2f308
commit 8dbc1b0503
122 changed files with 810 additions and 820 deletions

View File

@ -15,7 +15,7 @@ async function main () {
let checksum = crypto.createHash('sha256').update(headScript).digest('base64') let checksum = crypto.createHash('sha256').update(headScript).digest('base64')
let checksumFilepath = path.join(__dirname, '../inline-script-checksum.json') let checksumFilepath = path.join(__dirname, '../inline-script-checksum.json')
await writeFile(checksumFilepath, JSON.stringify({checksum}), 'utf8') await writeFile(checksumFilepath, JSON.stringify({ checksum }), 'utf8')
let html2xxFilepath = path.join(__dirname, '../templates/2xx.html') let html2xxFilepath = path.join(__dirname, '../templates/2xx.html')
let html2xxFile = await readFile(html2xxFilepath, 'utf8') let html2xxFile = await readFile(html2xxFilepath, 'utf8')

View File

@ -37,9 +37,9 @@ function doWatch () {
async function compileGlobalSass () { async function compileGlobalSass () {
let results = await Promise.all([ let results = await Promise.all([
render({file: defaultThemeScss, outputStyle: 'compressed'}), render({ file: defaultThemeScss, outputStyle: 'compressed' }),
render({file: globalScss, outputStyle: 'compressed'}), render({ file: globalScss, outputStyle: 'compressed' }),
render({file: offlineThemeScss, outputStyle: 'compressed'}) render({ file: offlineThemeScss, outputStyle: 'compressed' })
]) ])
let css = results.map(_ => _.css).join('') let css = results.map(_ => _.css).join('')
@ -54,7 +54,7 @@ async function compileGlobalSass () {
async function compileThemesSass () { async function compileThemesSass () {
let files = (await readdir(themesScssDir)).filter(file => !path.basename(file).startsWith('_')) let files = (await readdir(themesScssDir)).filter(file => !path.basename(file).startsWith('_'))
await Promise.all(files.map(async file => { await Promise.all(files.map(async file => {
let res = await render({file: path.join(themesScssDir, file), outputStyle: 'compressed'}) let res = await render({ file: path.join(themesScssDir, file), outputStyle: 'compressed' })
let outputFilename = 'theme-' + path.basename(file).replace(/\.scss$/, '.css') let outputFilename = 'theme-' + path.basename(file).replace(/\.scss$/, '.css')
await writeFile(path.join(assetsDir, outputFilename), res.css, 'utf8') await writeFile(path.join(assetsDir, outputFilename), res.css, 'utf8')
})) }))

View File

@ -56,24 +56,24 @@ async function setupMastodonDatabase () {
try { try {
await exec(`dropdb -h 127.0.0.1 -U ${DB_USER} -w ${DB_NAME}`, { await exec(`dropdb -h 127.0.0.1 -U ${DB_USER} -w ${DB_NAME}`, {
cwd: mastodonDir, cwd: mastodonDir,
env: Object.assign({PGPASSWORD: DB_PASS}, process.env) env: Object.assign({ PGPASSWORD: DB_PASS }, process.env)
}) })
} catch (e) { /* ignore */ } } catch (e) { /* ignore */ }
await exec(`createdb -h 127.0.0.1 -U ${DB_USER} -w ${DB_NAME}`, { await exec(`createdb -h 127.0.0.1 -U ${DB_USER} -w ${DB_NAME}`, {
cwd: mastodonDir, cwd: mastodonDir,
env: Object.assign({PGPASSWORD: DB_PASS}, process.env) env: Object.assign({ PGPASSWORD: DB_PASS }, process.env)
}) })
let dumpFile = path.join(dir, '../fixtures/dump.sql') let dumpFile = path.join(dir, '../fixtures/dump.sql')
await exec(`psql -h 127.0.0.1 -U ${DB_USER} -w -d ${DB_NAME} -f "${dumpFile}"`, { await exec(`psql -h 127.0.0.1 -U ${DB_USER} -w -d ${DB_NAME} -f "${dumpFile}"`, {
cwd: mastodonDir, cwd: mastodonDir,
env: Object.assign({PGPASSWORD: DB_PASS}, process.env) env: Object.assign({ PGPASSWORD: DB_PASS }, process.env)
}) })
let tgzFile = path.join(dir, '../fixtures/system.tgz') let tgzFile = path.join(dir, '../fixtures/system.tgz')
let systemDir = path.join(mastodonDir, 'public/system') let systemDir = path.join(mastodonDir, 'public/system')
await mkdirp(systemDir) await mkdirp(systemDir)
await exec(`tar -xzf "${tgzFile}"`, {cwd: systemDir}) await exec(`tar -xzf "${tgzFile}"`, { cwd: systemDir })
} }
async function runMastodon () { async function runMastodon () {
@ -97,10 +97,10 @@ async function runMastodon () {
for (let cmd of cmds) { for (let cmd of cmds) {
console.log(cmd) console.log(cmd)
await exec(cmd, {cwd, env}) await exec(cmd, { cwd, env })
} }
const promise = spawn('foreman', ['start'], {cwd, env}) const promise = spawn('foreman', ['start'], { cwd, env })
const log = fs.createWriteStream('mastodon.log', {flags: 'a'}) const log = fs.createWriteStream('mastodon.log', { flags: 'a' })
childProc = promise.childProcess childProc = promise.childProcess
childProc.stdout.pipe(log) childProc.stdout.pipe(log)
childProc.stderr.pipe(log) childProc.stderr.pipe(log)

View File

@ -1,40 +1,40 @@
module.exports = [ module.exports = [
{id: 'pinafore-logo', src: 'original-assets/sailboat.svg', title: 'Home'}, { id: 'pinafore-logo', src: 'original-assets/sailboat.svg', title: 'Home' },
{id: 'fa-bell', src: 'node_modules/font-awesome-svg-png/white/svg/bell.svg', title: 'Notifications'}, { id: 'fa-bell', src: 'node_modules/font-awesome-svg-png/white/svg/bell.svg', title: 'Notifications' },
{id: 'fa-users', src: 'node_modules/font-awesome-svg-png/white/svg/users.svg', title: 'Local'}, { id: 'fa-users', src: 'node_modules/font-awesome-svg-png/white/svg/users.svg', title: 'Local' },
{id: 'fa-globe', src: 'node_modules/font-awesome-svg-png/white/svg/globe.svg', title: 'Federated'}, { id: 'fa-globe', src: 'node_modules/font-awesome-svg-png/white/svg/globe.svg', title: 'Federated' },
{id: 'fa-gear', src: 'node_modules/font-awesome-svg-png/white/svg/gear.svg', title: 'Settings'}, { id: 'fa-gear', src: 'node_modules/font-awesome-svg-png/white/svg/gear.svg', title: 'Settings' },
{id: 'fa-reply', src: 'node_modules/font-awesome-svg-png/white/svg/reply.svg', title: 'Reply'}, { id: 'fa-reply', src: 'node_modules/font-awesome-svg-png/white/svg/reply.svg', title: 'Reply' },
{id: 'fa-reply-all', src: 'node_modules/font-awesome-svg-png/white/svg/reply-all.svg', title: 'Reply to thread'}, { id: 'fa-reply-all', src: 'node_modules/font-awesome-svg-png/white/svg/reply-all.svg', title: 'Reply to thread' },
{id: 'fa-retweet', src: 'node_modules/font-awesome-svg-png/white/svg/retweet.svg', title: 'Boost'}, { id: 'fa-retweet', src: 'node_modules/font-awesome-svg-png/white/svg/retweet.svg', title: 'Boost' },
{id: 'fa-star', src: 'node_modules/font-awesome-svg-png/white/svg/star.svg', title: 'Favorite'}, { id: 'fa-star', src: 'node_modules/font-awesome-svg-png/white/svg/star.svg', title: 'Favorite' },
{id: 'fa-ellipsis-h', src: 'node_modules/font-awesome-svg-png/white/svg/ellipsis-h.svg', title: 'More'}, { id: 'fa-ellipsis-h', src: 'node_modules/font-awesome-svg-png/white/svg/ellipsis-h.svg', title: 'More' },
{id: 'fa-spinner', src: 'node_modules/font-awesome-svg-png/white/svg/spinner.svg', title: 'Spinner'}, { id: 'fa-spinner', src: 'node_modules/font-awesome-svg-png/white/svg/spinner.svg', title: 'Spinner' },
{id: 'fa-user', src: 'node_modules/font-awesome-svg-png/white/svg/user.svg', title: 'Empty user profile'}, { id: 'fa-user', src: 'node_modules/font-awesome-svg-png/white/svg/user.svg', title: 'Empty user profile' },
{id: 'fa-play-circle', src: 'node_modules/font-awesome-svg-png/white/svg/play-circle.svg', title: 'Play'}, { id: 'fa-play-circle', src: 'node_modules/font-awesome-svg-png/white/svg/play-circle.svg', title: 'Play' },
{id: 'fa-eye', src: 'node_modules/font-awesome-svg-png/white/svg/eye.svg', title: 'Show Sensitive Content'}, { id: 'fa-eye', src: 'node_modules/font-awesome-svg-png/white/svg/eye.svg', title: 'Show Sensitive Content' },
{id: 'fa-eye-slash', src: 'node_modules/font-awesome-svg-png/white/svg/eye-slash.svg', title: 'Hide Sensitive Content'}, { id: 'fa-eye-slash', src: 'node_modules/font-awesome-svg-png/white/svg/eye-slash.svg', title: 'Hide Sensitive Content' },
{id: 'fa-lock', src: 'node_modules/font-awesome-svg-png/white/svg/lock.svg', title: 'Locked'}, { id: 'fa-lock', src: 'node_modules/font-awesome-svg-png/white/svg/lock.svg', title: 'Locked' },
{id: 'fa-unlock', src: 'node_modules/font-awesome-svg-png/white/svg/unlock.svg', title: 'Unlocked'}, { id: 'fa-unlock', src: 'node_modules/font-awesome-svg-png/white/svg/unlock.svg', title: 'Unlocked' },
{id: 'fa-envelope', src: 'node_modules/font-awesome-svg-png/white/svg/envelope.svg', title: 'Sealed Envelope'}, { id: 'fa-envelope', src: 'node_modules/font-awesome-svg-png/white/svg/envelope.svg', title: 'Sealed Envelope' },
{id: 'fa-user-times', src: 'node_modules/font-awesome-svg-png/white/svg/user-times.svg', title: 'Stop Following'}, { id: 'fa-user-times', src: 'node_modules/font-awesome-svg-png/white/svg/user-times.svg', title: 'Stop Following' },
{id: 'fa-user-plus', src: 'node_modules/font-awesome-svg-png/white/svg/user-plus.svg', title: 'Follow'}, { id: 'fa-user-plus', src: 'node_modules/font-awesome-svg-png/white/svg/user-plus.svg', title: 'Follow' },
{id: 'fa-external-link', src: 'node_modules/font-awesome-svg-png/white/svg/external-link.svg', title: 'External Link'}, { id: 'fa-external-link', src: 'node_modules/font-awesome-svg-png/white/svg/external-link.svg', title: 'External Link' },
{id: 'fa-search', src: 'node_modules/font-awesome-svg-png/white/svg/search.svg', title: 'Search'}, { id: 'fa-search', src: 'node_modules/font-awesome-svg-png/white/svg/search.svg', title: 'Search' },
{id: 'fa-comments', src: 'node_modules/font-awesome-svg-png/white/svg/comments.svg', title: 'Conversations'}, { id: 'fa-comments', src: 'node_modules/font-awesome-svg-png/white/svg/comments.svg', title: 'Conversations' },
{id: 'fa-paperclip', src: 'node_modules/font-awesome-svg-png/white/svg/paperclip.svg', title: 'Paperclip'}, { id: 'fa-paperclip', src: 'node_modules/font-awesome-svg-png/white/svg/paperclip.svg', title: 'Paperclip' },
{id: 'fa-thumb-tack', src: 'node_modules/font-awesome-svg-png/white/svg/thumb-tack.svg', title: 'Thumbtack'}, { id: 'fa-thumb-tack', src: 'node_modules/font-awesome-svg-png/white/svg/thumb-tack.svg', title: 'Thumbtack' },
{id: 'fa-bars', src: 'node_modules/font-awesome-svg-png/white/svg/bars.svg', title: 'List'}, { id: 'fa-bars', src: 'node_modules/font-awesome-svg-png/white/svg/bars.svg', title: 'List' },
{id: 'fa-ban', src: 'node_modules/font-awesome-svg-png/white/svg/ban.svg', title: 'Ban'}, { id: 'fa-ban', src: 'node_modules/font-awesome-svg-png/white/svg/ban.svg', title: 'Ban' },
{id: 'fa-camera', src: 'node_modules/font-awesome-svg-png/white/svg/camera.svg', title: 'Add media'}, { id: 'fa-camera', src: 'node_modules/font-awesome-svg-png/white/svg/camera.svg', title: 'Add media' },
{id: 'fa-smile', src: 'node_modules/font-awesome-svg-png/white/svg/smile-o.svg', title: 'Custom emoji'}, { id: 'fa-smile', src: 'node_modules/font-awesome-svg-png/white/svg/smile-o.svg', title: 'Custom emoji' },
{id: 'fa-exclamation-triangle', src: 'node_modules/font-awesome-svg-png/white/svg/exclamation-triangle.svg', title: 'Content warning'}, { id: 'fa-exclamation-triangle', src: 'node_modules/font-awesome-svg-png/white/svg/exclamation-triangle.svg', title: 'Content warning' },
{id: 'fa-check', src: 'node_modules/font-awesome-svg-png/white/svg/check.svg', title: 'Check'}, { id: 'fa-check', src: 'node_modules/font-awesome-svg-png/white/svg/check.svg', title: 'Check' },
{id: 'fa-trash', src: 'node_modules/font-awesome-svg-png/white/svg/trash-o.svg', title: 'Delete'}, { id: 'fa-trash', src: 'node_modules/font-awesome-svg-png/white/svg/trash-o.svg', title: 'Delete' },
{id: 'fa-hourglass', src: 'node_modules/font-awesome-svg-png/white/svg/hourglass.svg', title: 'Follow requested'}, { id: 'fa-hourglass', src: 'node_modules/font-awesome-svg-png/white/svg/hourglass.svg', title: 'Follow requested' },
{id: 'fa-pencil', src: 'node_modules/font-awesome-svg-png/white/svg/pencil.svg', title: 'Compose'}, { id: 'fa-pencil', src: 'node_modules/font-awesome-svg-png/white/svg/pencil.svg', title: 'Compose' },
{id: 'fa-times', src: 'node_modules/font-awesome-svg-png/white/svg/times.svg', title: 'Close'}, { id: 'fa-times', src: 'node_modules/font-awesome-svg-png/white/svg/times.svg', title: 'Close' },
{id: 'fa-volume-off', src: 'node_modules/font-awesome-svg-png/white/svg/volume-off.svg', title: 'Mute'}, { id: 'fa-volume-off', src: 'node_modules/font-awesome-svg-png/white/svg/volume-off.svg', title: 'Mute' },
{id: 'fa-volume-up', src: 'node_modules/font-awesome-svg-png/white/svg/volume-up.svg', title: 'Unmute'}, { id: 'fa-volume-up', src: 'node_modules/font-awesome-svg-png/white/svg/volume-up.svg', title: 'Unmute' },
{id: 'fa-link', src: 'node_modules/font-awesome-svg-png/white/svg/link.svg', title: 'Link'} { id: 'fa-link', src: 'node_modules/font-awesome-svg-png/white/svg/link.svg', title: 'Link' }
] ]

814
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -105,7 +105,7 @@
"devDependencies": { "devDependencies": {
"eslint-plugin-html": "^4.0.5", "eslint-plugin-html": "^4.0.5",
"now": "^11.4.0", "now": "^11.4.0",
"standard": "^11.0.1", "standard": "^12.0.0",
"testcafe": "^0.21.1" "testcafe": "^0.21.1"
}, },
"engines": { "engines": {

View File

@ -11,12 +11,12 @@ async function _updateAccount (accountId, instanceName, accessToken) {
}) })
try { try {
store.set({currentAccountProfile: (await localPromise)}) store.set({ currentAccountProfile: (await localPromise) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
try { try {
store.set({currentAccountProfile: (await remotePromise)}) store.set({ currentAccountProfile: (await remotePromise) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
@ -29,12 +29,12 @@ async function _updateRelationship (accountId, instanceName, accessToken) {
return relationship return relationship
}) })
try { try {
store.set({currentAccountRelationship: (await localPromise)}) store.set({ currentAccountRelationship: (await localPromise) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
try { try {
store.set({currentAccountRelationship: (await remotePromise)}) store.set({ currentAccountRelationship: (await remotePromise) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
@ -43,7 +43,7 @@ async function _updateRelationship (accountId, instanceName, accessToken) {
export async function updateLocalRelationship (instanceName, accountId, relationship) { export async function updateLocalRelationship (instanceName, accountId, relationship) {
await database.setRelationship(instanceName, relationship) await database.setRelationship(instanceName, relationship)
try { try {
store.set({currentAccountRelationship: relationship}) store.set({ currentAccountRelationship: relationship })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }

View File

@ -14,7 +14,7 @@ async function redirectToOauth () {
let { instanceNameInSearch, loggedInInstances } = store.get() let { instanceNameInSearch, loggedInInstances } = store.get()
instanceNameInSearch = instanceNameInSearch.replace(/^https?:\/\//, '').replace(/\/$/, '').replace('/$', '').toLowerCase() instanceNameInSearch = instanceNameInSearch.replace(/^https?:\/\//, '').replace(/\/$/, '').replace('/$', '').toLowerCase()
if (Object.keys(loggedInInstances).includes(instanceNameInSearch)) { if (Object.keys(loggedInInstances).includes(instanceNameInSearch)) {
store.set({logInToInstanceError: `You've already logged in to ${instanceNameInSearch}`}) store.set({ logInToInstanceError: `You've already logged in to ${instanceNameInSearch}` })
return return
} }
let registrationPromise = registerApplication(instanceNameInSearch, REDIRECT_URI) let registrationPromise = registerApplication(instanceNameInSearch, REDIRECT_URI)
@ -54,7 +54,7 @@ export async function logInToInstance () {
logInToInstanceErrorForText: instanceNameInSearch logInToInstanceErrorForText: instanceNameInSearch
}) })
} finally { } finally {
store.set({logInToInstanceLoading: false}) store.set({ logInToInstanceLoading: false })
} }
} }
@ -92,11 +92,11 @@ async function registerNewInstance (code) {
export async function handleOauthCode (code) { export async function handleOauthCode (code) {
try { try {
store.set({logInToInstanceLoading: true}) store.set({ logInToInstanceLoading: true })
await registerNewInstance(code) await registerNewInstance(code)
} catch (err) { } catch (err) {
store.set({logInToInstanceError: `${err.message || err.name}. Failed to connect to instance.`}) store.set({ logInToInstanceError: `${err.message || err.name}. Failed to connect to instance.` })
} finally { } finally {
store.set({logInToInstanceLoading: false}) store.set({ logInToInstanceLoading: false })
} }
} }

View File

@ -34,7 +34,7 @@ async function insertUpdatesIntoTimeline (instanceName, timelineName, updates) {
if (!isEqual(itemIdsToAdd, newItemIdsToAdd)) { if (!isEqual(itemIdsToAdd, newItemIdsToAdd)) {
console.log('adding ', (newItemIdsToAdd.length - itemIdsToAdd.length), console.log('adding ', (newItemIdsToAdd.length - itemIdsToAdd.length),
'items to itemIdsToAdd for timeline', timelineName) 'items to itemIdsToAdd for timeline', timelineName)
store.setForTimeline(instanceName, timelineName, {itemIdsToAdd: newItemIdsToAdd}) store.setForTimeline(instanceName, timelineName, { itemIdsToAdd: newItemIdsToAdd })
} }
} }
@ -58,7 +58,7 @@ async function insertUpdatesIntoThreads (instanceName, updates) {
if (!isEqual(itemIdsToAdd, newItemIdsToAdd)) { if (!isEqual(itemIdsToAdd, newItemIdsToAdd)) {
console.log('adding ', (newItemIdsToAdd.length - itemIdsToAdd.length), console.log('adding ', (newItemIdsToAdd.length - itemIdsToAdd.length),
'items to itemIdsToAdd for thread', timelineName) 'items to itemIdsToAdd for thread', timelineName)
store.setForTimeline(instanceName, timelineName, {itemIdsToAdd: newItemIdsToAdd}) store.setForTimeline(instanceName, timelineName, { itemIdsToAdd: newItemIdsToAdd })
} }
} }
} }
@ -68,7 +68,7 @@ async function processFreshUpdates (instanceName, timelineName) {
let freshUpdates = store.getForTimeline(instanceName, timelineName, 'freshUpdates') let freshUpdates = store.getForTimeline(instanceName, timelineName, 'freshUpdates')
if (freshUpdates && freshUpdates.length) { if (freshUpdates && freshUpdates.length) {
let updates = freshUpdates.slice() let updates = freshUpdates.slice()
store.setForTimeline(instanceName, timelineName, {freshUpdates: []}) store.setForTimeline(instanceName, timelineName, { freshUpdates: [] })
await Promise.all([ await Promise.all([
insertUpdatesIntoTimeline(instanceName, timelineName, updates), insertUpdatesIntoTimeline(instanceName, timelineName, updates),
@ -93,6 +93,6 @@ export function addStatusesOrNotifications (instanceName, timelineName, newStatu
let freshUpdates = store.getForTimeline(instanceName, timelineName, 'freshUpdates') || [] let freshUpdates = store.getForTimeline(instanceName, timelineName, 'freshUpdates') || []
freshUpdates = [].concat(freshUpdates).concat(newStatusesOrNotifications) freshUpdates = [].concat(freshUpdates).concat(newStatusesOrNotifications)
freshUpdates = uniqBy(freshUpdates, _ => _.id) freshUpdates = uniqBy(freshUpdates, _ => _.id)
store.setForTimeline(instanceName, timelineName, {freshUpdates: freshUpdates}) store.setForTimeline(instanceName, timelineName, { freshUpdates: freshUpdates })
lazilyProcessFreshUpdates(instanceName, timelineName) lazilyProcessFreshUpdates(instanceName, timelineName)
} }

View File

@ -6,8 +6,8 @@ export async function insertUsername (realm, username, startIndex, endIndex) {
let pre = oldText.substring(0, startIndex) let pre = oldText.substring(0, startIndex)
let post = oldText.substring(endIndex) let post = oldText.substring(endIndex)
let newText = `${pre}@${username} ${post}` let newText = `${pre}@${username} ${post}`
store.setComposeData(realm, {text: newText}) store.setComposeData(realm, { text: newText })
store.setForAutosuggest(currentInstance, realm, {autosuggestSearchResults: []}) store.setForAutosuggest(currentInstance, realm, { autosuggestSearchResults: [] })
} }
export async function clickSelectedAutosuggestionUsername (realm) { export async function clickSelectedAutosuggestionUsername (realm) {
@ -29,8 +29,8 @@ export function insertEmojiAtPosition (realm, emoji, startIndex, endIndex) {
let pre = oldText.substring(0, startIndex) let pre = oldText.substring(0, startIndex)
let post = oldText.substring(endIndex) let post = oldText.substring(endIndex)
let newText = `${pre}:${emoji.shortcode}: ${post}` let newText = `${pre}:${emoji.shortcode}: ${post}`
store.setComposeData(realm, {text: newText}) store.setComposeData(realm, { text: newText })
store.setForAutosuggest(currentInstance, realm, {autosuggestSearchResults: []}) store.setForAutosuggest(currentInstance, realm, { autosuggestSearchResults: [] })
} }
export async function clickSelectedAutosuggestionEmoji (realm) { export async function clickSelectedAutosuggestionEmoji (realm) {

View File

@ -49,7 +49,7 @@ export async function postStatus (realm, text, inReplyToId, mediaIds,
console.error(e) console.error(e)
toast.say('Unable to post status: ' + (e.message || '')) toast.say('Unable to post status: ' + (e.message || ''))
} finally { } finally {
store.set({postingStatus: false}) store.set({ postingStatus: false })
} }
} }
@ -84,5 +84,5 @@ export function setReplyVisibility (realm, replyVisibility) {
let visibility = PRIVACY_LEVEL[replyVisibility] < PRIVACY_LEVEL[defaultVisibility] let visibility = PRIVACY_LEVEL[replyVisibility] < PRIVACY_LEVEL[defaultVisibility]
? replyVisibility ? replyVisibility
: defaultVisibility : defaultVisibility
store.setComposeData(realm, {postPrivacy: visibility}) store.setComposeData(realm, { postPrivacy: visibility })
} }

View File

@ -11,7 +11,7 @@ export async function updateCustomEmojiForInstance (instanceName) {
emoji => { emoji => {
let { customEmoji } = store.get() let { customEmoji } = store.get()
customEmoji[instanceName] = emoji customEmoji[instanceName] = emoji
store.set({customEmoji: customEmoji}) store.set({ customEmoji: customEmoji })
} }
) )
} }
@ -23,5 +23,5 @@ export function insertEmoji (realm, emoji) {
let pre = oldText.substring(0, idx) let pre = oldText.substring(0, idx)
let post = oldText.substring(idx) let post = oldText.substring(idx)
let newText = `${pre}:${emoji.shortcode}: ${post}` let newText = `${pre}:${emoji.shortcode}: ${post}`
store.setComposeData(realm, {text: newText}) store.setComposeData(realm, { text: newText })
} }

View File

@ -3,15 +3,15 @@ import { auth, basename } from '../_api/utils'
export async function getFollowRequests (instanceName, accessToken) { export async function getFollowRequests (instanceName, accessToken) {
let url = `${basename(instanceName)}/api/v1/follow_requests` let url = `${basename(instanceName)}/api/v1/follow_requests`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export async function authorizeFollowRequest (instanceName, accessToken, id) { export async function authorizeFollowRequest (instanceName, accessToken, id) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/authorize` let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/authorize`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function rejectFollowRequest (instanceName, accessToken, id) { export async function rejectFollowRequest (instanceName, accessToken, id) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/reject` let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/reject`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -10,7 +10,7 @@ import { database } from '../_database/database'
export function changeTheme (instanceName, newTheme) { export function changeTheme (instanceName, newTheme) {
let { instanceThemes } = store.get() let { instanceThemes } = store.get()
instanceThemes[instanceName] = newTheme instanceThemes[instanceName] = newTheme
store.set({instanceThemes: instanceThemes}) store.set({ instanceThemes: instanceThemes })
store.save() store.save()
let { currentInstance } = store.get() let { currentInstance } = store.get()
if (instanceName === currentInstance) { if (instanceName === currentInstance) {
@ -63,7 +63,7 @@ export async function logOutOfInstance (instanceName) {
function setStoreVerifyCredentials (instanceName, thisVerifyCredentials) { function setStoreVerifyCredentials (instanceName, thisVerifyCredentials) {
let { verifyCredentials } = store.get() let { verifyCredentials } = store.get()
verifyCredentials[instanceName] = thisVerifyCredentials verifyCredentials[instanceName] = thisVerifyCredentials
store.set({verifyCredentials: verifyCredentials}) store.set({ verifyCredentials: verifyCredentials })
} }
export async function updateVerifyCredentialsForInstance (instanceName) { export async function updateVerifyCredentialsForInstance (instanceName) {
@ -90,7 +90,7 @@ export async function updateInstanceInfo (instanceName) {
info => { info => {
let { instanceInfos } = store.get() let { instanceInfos } = store.get()
instanceInfos[instanceName] = info instanceInfos[instanceName] = info
store.set({instanceInfos: instanceInfos}) store.set({ instanceInfos: instanceInfos })
} }
) )
} }

View File

@ -13,7 +13,7 @@ export async function updateLists () {
lists => { lists => {
let { instanceLists } = store.get() let { instanceLists } = store.get()
instanceLists[currentInstance] = lists instanceLists[currentInstance] = lists
store.set({instanceLists: instanceLists}) store.set({ instanceLists: instanceLists })
} }
) )
} }

View File

@ -5,7 +5,7 @@ import { scheduleIdleTask } from '../_utils/scheduleIdleTask'
export async function doMediaUpload (realm, file) { export async function doMediaUpload (realm, file) {
let { currentInstance, accessToken } = store.get() let { currentInstance, accessToken } = store.get()
store.set({uploadingMedia: true}) store.set({ uploadingMedia: true })
try { try {
let response = await uploadMedia(currentInstance, accessToken, file) let response = await uploadMedia(currentInstance, accessToken, file)
let composeMedia = store.getComposeData(realm, 'media') || [] let composeMedia = store.getComposeData(realm, 'media') || []
@ -22,7 +22,7 @@ export async function doMediaUpload (realm, file) {
console.error(e) console.error(e)
toast.say('Failed to upload media: ' + (e.message || '')) toast.say('Failed to upload media: ' + (e.message || ''))
} finally { } finally {
store.set({uploadingMedia: false}) store.set({ uploadingMedia: false })
} }
} }

View File

@ -16,7 +16,7 @@ export async function updatePinnedStatusesForAccount (accountId) {
let { pinnedStatuses } = store.get() let { pinnedStatuses } = store.get()
pinnedStatuses[currentInstance] = pinnedStatuses[currentInstance] || {} pinnedStatuses[currentInstance] = pinnedStatuses[currentInstance] || {}
pinnedStatuses[currentInstance][accountId] = statuses pinnedStatuses[currentInstance][accountId] = statuses
store.set({pinnedStatuses: pinnedStatuses}) store.set({ pinnedStatuses: pinnedStatuses })
} }
) )
} }

View File

@ -2,5 +2,5 @@
import { store } from '../_store/store' import { store } from '../_store/store'
export function setPostPrivacy (realm, postPrivacyKey) { export function setPostPrivacy (realm, postPrivacyKey) {
store.setComposeData(realm, {postPrivacy: postPrivacyKey}) store.setComposeData(realm, { postPrivacy: postPrivacyKey })
} }

View File

@ -4,7 +4,7 @@ import { search } from '../_api/search'
export async function doSearch () { export async function doSearch () {
let { currentInstance, accessToken, queryInSearch } = store.get() let { currentInstance, accessToken, queryInSearch } = store.get()
store.set({searchLoading: true}) store.set({ searchLoading: true })
try { try {
let results = await search(currentInstance, accessToken, queryInSearch) let results = await search(currentInstance, accessToken, queryInSearch)
let { queryInSearch: newQueryInSearch } = store.get() // avoid race conditions let { queryInSearch: newQueryInSearch } = store.get() // avoid race conditions
@ -18,6 +18,6 @@ export async function doSearch () {
toast.say('Error during search: ' + (e.name || '') + ' ' + (e.message || '')) toast.say('Error during search: ' + (e.name || '') + ' ' + (e.message || ''))
console.error(e) console.error(e)
} finally { } finally {
store.set({searchLoading: false}) store.set({ searchLoading: false })
} }
} }

View File

@ -72,10 +72,10 @@ export async function addTimelineItemIds (instanceName, timelineName, newIds, ne
let mergedIds = mergeArrays(oldIds || [], newIds) let mergedIds = mergeArrays(oldIds || [], newIds)
if (!isEqual(oldIds, mergedIds)) { if (!isEqual(oldIds, mergedIds)) {
store.setForTimeline(instanceName, timelineName, {timelineItemIds: mergedIds}) store.setForTimeline(instanceName, timelineName, { timelineItemIds: mergedIds })
} }
if (oldStale !== newStale) { if (oldStale !== newStale) {
store.setForTimeline(instanceName, timelineName, {timelineItemIdsAreStale: newStale}) store.setForTimeline(instanceName, timelineName, { timelineItemIdsAreStale: newStale })
} }
} }

View File

@ -3,10 +3,10 @@ import { post, WRITE_TIMEOUT } from '../_utils/ajax'
export async function blockAccount (instanceName, accessToken, accountId) { export async function blockAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/block` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/block`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unblockAccount (instanceName, accessToken, accountId) { export async function unblockAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unblock` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unblock`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { auth, basename } from './utils'
export async function blockDomain (instanceName, accessToken, domain) { export async function blockDomain (instanceName, accessToken, domain) {
let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}` let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unblockDomain (instanceName, accessToken, domain) { export async function unblockDomain (instanceName, accessToken, domain) {
let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}` let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}`
return del(url, auth(accessToken), {timeout: WRITE_TIMEOUT}) return del(url, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -4,11 +4,11 @@ import { auth, basename } from './utils'
export async function getBlockedAccounts (instanceName, accessToken, limit = 80) { export async function getBlockedAccounts (instanceName, accessToken, limit = 80) {
let url = `${basename(instanceName)}/api/v1/blocks` let url = `${basename(instanceName)}/api/v1/blocks`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export async function getMutedAccounts (instanceName, accessToken, limit = 80) { export async function getMutedAccounts (instanceName, accessToken, limit = 80) {
let url = `${basename(instanceName)}/api/v1/mutes` let url = `${basename(instanceName)}/api/v1/mutes`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { del, WRITE_TIMEOUT } from '../_utils/ajax'
export async function deleteStatus (instanceName, accessToken, statusId) { export async function deleteStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}`
return del(url, auth(accessToken), {timeout: WRITE_TIMEOUT}) return del(url, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { DEFAULT_TIMEOUT, get } from '../_utils/ajax'
export async function getCustomEmoji (instanceName) { export async function getCustomEmoji (instanceName) {
let url = `${basename(instanceName)}/api/v1/custom_emojis` let url = `${basename(instanceName)}/api/v1/custom_emojis`
return get(url, null, {timeout: DEFAULT_TIMEOUT}) return get(url, null, { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { basename, auth } from './utils'
export async function favoriteStatus (instanceName, accessToken, statusId) { export async function favoriteStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/favourite` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/favourite`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unfavoriteStatus (instanceName, accessToken, statusId) { export async function unfavoriteStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unfavourite` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unfavourite`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { auth, basename } from './utils'
export async function followAccount (instanceName, accessToken, accountId) { export async function followAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/follow` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/follow`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unfollowAccount (instanceName, accessToken, accountId) { export async function unfollowAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unfollow` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unfollow`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -4,11 +4,11 @@ import { auth, basename } from './utils'
export async function getFollows (instanceName, accessToken, accountId, limit = 80) { export async function getFollows (instanceName, accessToken, accountId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/following` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/following`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export async function getFollowers (instanceName, accessToken, accountId, limit = 80) { export async function getFollowers (instanceName, accessToken, accountId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/followers` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/followers`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { basename } from './utils'
export function getInstanceInfo (instanceName) { export function getInstanceInfo (instanceName) {
let url = `${basename(instanceName)}/api/v1/instance` let url = `${basename(instanceName)}/api/v1/instance`
return get(url, null, {timeout: DEFAULT_TIMEOUT}) return get(url, null, { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { auth, basename } from './utils'
export function getLists (instanceName, accessToken) { export function getLists (instanceName, accessToken) {
let url = `${basename(instanceName)}/api/v1/lists` let url = `${basename(instanceName)}/api/v1/lists`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -8,10 +8,10 @@ export async function uploadMedia (instanceName, accessToken, file, description)
formData.append('description', description) formData.append('description', description)
} }
let url = `${basename(instanceName)}/api/v1/media` let url = `${basename(instanceName)}/api/v1/media`
return post(url, formData, auth(accessToken), {timeout: MEDIA_WRITE_TIMEOUT}) return post(url, formData, auth(accessToken), { timeout: MEDIA_WRITE_TIMEOUT })
} }
export async function putMediaDescription (instanceName, accessToken, mediaId, description) { export async function putMediaDescription (instanceName, accessToken, mediaId, description) {
let url = `${basename(instanceName)}/api/v1/media/${mediaId}` let url = `${basename(instanceName)}/api/v1/media/${mediaId}`
return put(url, {description}, auth(accessToken), {timeout: WRITE_TIMEOUT}) return put(url, { description }, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { post, WRITE_TIMEOUT } from '../_utils/ajax'
export async function muteAccount (instanceName, accessToken, accountId) { export async function muteAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/mute` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/mute`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unmuteAccount (instanceName, accessToken, accountId) { export async function unmuteAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unmute` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unmute`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { post, WRITE_TIMEOUT } from '../_utils/ajax'
export async function muteConversation (instanceName, accessToken, statusId) { export async function muteConversation (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/mute` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/mute`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unmuteConversation (instanceName, accessToken, statusId) { export async function unmuteConversation (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unmute` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unmute`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -12,7 +12,7 @@ export function registerApplication (instanceName, redirectUri) {
redirect_uris: redirectUri, redirect_uris: redirectUri,
scopes: SCOPES, scopes: SCOPES,
website: WEBSITE website: WEBSITE
}, null, {timeout: WRITE_TIMEOUT}) }, null, { timeout: WRITE_TIMEOUT })
} }
export function generateAuthLink (instanceName, clientId, redirectUri) { export function generateAuthLink (instanceName, clientId, redirectUri) {
@ -33,5 +33,5 @@ export function getAccessTokenFromAuthCode (instanceName, clientId, clientSecret
redirect_uri: redirectUri, redirect_uri: redirectUri,
grant_type: 'authorization_code', grant_type: 'authorization_code',
code: code code: code
}, null, {timeout: WRITE_TIMEOUT}) }, null, { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { auth, basename } from './utils'
export async function pinStatus (instanceName, accessToken, statusId) { export async function pinStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/pin` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/pin`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function unpinStatus (instanceName, accessToken, statusId) { export async function unpinStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unpin` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unpin`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -7,5 +7,5 @@ export async function getPinnedStatuses (instanceName, accessToken, accountId) {
limit: 40, limit: 40,
pinned: true pinned: true
}) })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -4,11 +4,11 @@ import { auth, basename } from './utils'
export async function getReblogs (instanceName, accessToken, statusId, limit = 80) { export async function getReblogs (instanceName, accessToken, statusId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/reblogged_by` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/reblogged_by`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export async function getFavorites (instanceName, accessToken, statusId, limit = 80) { export async function getFavorites (instanceName, accessToken, statusId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/favourited_by` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/favourited_by`
url += '?' + paramsString({ limit }) url += '?' + paramsString({ limit })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -2,7 +2,7 @@ import { basename, auth } from './utils'
import { get, paramsString, DEFAULT_TIMEOUT } from '../_utils/ajax' import { get, paramsString, DEFAULT_TIMEOUT } from '../_utils/ajax'
export async function getRelationship (instanceName, accessToken, accountId) { export async function getRelationship (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/relationships?${paramsString({id: accountId})}` let url = `${basename(instanceName)}/api/v1/accounts/relationships?${paramsString({ id: accountId })}`
let res = await get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) let res = await get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
return res[0] return res[0]
} }

View File

@ -3,10 +3,10 @@ import { auth, basename } from './utils'
export async function approveFollowRequest (instanceName, accessToken, accountId) { export async function approveFollowRequest (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/authorize` let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/authorize`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function rejectFollowRequest (instanceName, accessToken, accountId) { export async function rejectFollowRequest (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/reject` let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/reject`
return post(url, null, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -6,5 +6,5 @@ export function search (instanceName, accessToken, query) {
q: query, q: query,
resolve: true resolve: true
}) })
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { post, WRITE_TIMEOUT } from '../_utils/ajax'
export function setShowReblogs (instanceName, accessToken, accountId, showReblogs) { export function setShowReblogs (instanceName, accessToken, accountId, showReblogs) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/follow` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/follow`
return post(url, { reblogs: !!showReblogs }, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, { reblogs: !!showReblogs }, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -22,15 +22,15 @@ export async function postStatus (instanceName, accessToken, text, inReplyToId,
} }
} }
return post(url, body, auth(accessToken), {timeout: WRITE_TIMEOUT}) return post(url, body, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }
export async function getStatusContext (instanceName, accessToken, statusId) { export async function getStatusContext (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/context` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/context`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export async function getStatus (instanceName, accessToken, statusId) { export async function getStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}` let url = `${basename(instanceName)}/api/v1/statuses/${statusId}`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -49,5 +49,5 @@ export function getTimeline (instanceName, accessToken, timeline, maxId, since)
url += '?' + paramsString(params) url += '?' + paramsString(params)
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -3,5 +3,5 @@ import { auth, basename } from './utils'
export async function updateCredentials (instanceName, accessToken, accountData) { export async function updateCredentials (instanceName, accessToken, accountData) {
let url = `${basename(instanceName)}/api/v1/accounts/update_credentials` let url = `${basename(instanceName)}/api/v1/accounts/update_credentials`
return patch(url, accountData, auth(accessToken), {timeout: WRITE_TIMEOUT}) return patch(url, accountData, auth(accessToken), { timeout: WRITE_TIMEOUT })
} }

View File

@ -3,10 +3,10 @@ import { auth, basename } from './utils'
export function getVerifyCredentials (instanceName, accessToken) { export function getVerifyCredentials (instanceName, accessToken) {
let url = `${basename(instanceName)}/api/v1/accounts/verify_credentials` let url = `${basename(instanceName)}/api/v1/accounts/verify_credentials`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }
export function getAccount (instanceName, accessToken, accountId) { export function getAccount (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}` let url = `${basename(instanceName)}/api/v1/accounts/${accountId}`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT}) return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
} }

View File

@ -45,7 +45,7 @@
} catch (e) { } catch (e) {
toast.say('Error: ' + (e.name || '') + ' ' + (e.message || '')) toast.say('Error: ' + (e.name || '') + ' ' + (e.message || ''))
} finally { } finally {
this.set({loading: false}) this.set({ loading: false })
} }
on('refreshAccountsList', this, () => this.refreshAccounts()) on('refreshAccountsList', this, () => this.refreshAccounts())
}, },

View File

@ -136,7 +136,7 @@
return return
} }
let svg = this.refs.svg let svg = this.refs.svg
let animations = animation.map(({properties, options}) => svg.animate(properties, options)) let animations = animation.map(({ properties, options }) => svg.animate(properties, options))
animations.forEach(anim => anim.play()) animations.forEach(anim => anim.play())
} }
} }

View File

@ -30,7 +30,7 @@
this.refs.container.focus() this.refs.container.focus()
} }
let { page } = this.get() let { page } = this.get()
this.store.set({currentPage: page}) this.store.set({ currentPage: page })
}, },
store: () => store store: () => store
} }

View File

@ -29,7 +29,7 @@
this.set({ displaySrc: src }) this.set({ displaySrc: src })
} catch (e) { } catch (e) {
if (fallback) { if (fallback) {
this.set({displaySrc: fallback}) this.set({ displaySrc: fallback })
} }
} }
stop('LazyImage oncreate()') stop('LazyImage oncreate()')
@ -47,7 +47,7 @@
title: '' title: ''
}), }),
computed: { computed: {
computedStyle: ({width, height, background}) => { computedStyle: ({ width, height, background }) => {
return [ return [
width && `width: ${width}px;`, width && `width: ${width}px;`,
height && `height: ${height}px;`, height && `height: ${height}px;`,

View File

@ -15,7 +15,7 @@
firstTime = false firstTime = false
requestAnimationFrame(() => { requestAnimationFrame(() => {
requestAnimationFrame(() => { requestAnimationFrame(() => {
this.set({revealed: true}) this.set({ revealed: true })
}) })
}) })
}, },

View File

@ -23,7 +23,7 @@
export default { export default {
oncreate () { oncreate () {
setTimeout(() => { setTimeout(() => {
this.set({shown: true}) this.set({ shown: true })
}, SPINNER_DELAY) }, SPINNER_DELAY)
}, },
data: () => ({ data: () => ({

View File

@ -159,16 +159,16 @@
oncreate () { oncreate () {
let { name } = this.get() let { name } = this.get()
let indicator = this.refs.indicator let indicator = this.refs.indicator
on('animateNavPart1', this, ({fromPage, toPage}) => { on('animateNavPart1', this, ({ fromPage, toPage }) => {
if (fromPage !== name) { if (fromPage !== name) {
return return
} }
mark('animateNavPart1 gBCR') mark('animateNavPart1 gBCR')
let fromRect = indicator.getBoundingClientRect() let fromRect = indicator.getBoundingClientRect()
stop('animateNavPart1 gBCR') stop('animateNavPart1 gBCR')
emit('animateNavPart2', {fromRect, fromPage, toPage}) emit('animateNavPart2', { fromRect, fromPage, toPage })
}) })
on('animateNavPart2', this, ({fromPage, fromRect, toPage}) => { on('animateNavPart2', this, ({ fromPage, fromRect, toPage }) => {
if (toPage !== name) { if (toPage !== name) {
return return
} }

View File

@ -44,7 +44,7 @@
export default { export default {
methods: { methods: {
onMouseOver (mouseOver) { onMouseOver (mouseOver) {
this.set({playing: mouseOver}) this.set({ playing: mouseOver })
} }
}, },
events: { events: {

View File

@ -50,7 +50,7 @@
title: '' title: ''
}), }),
computed: { computed: {
computedClass: ({className, src, staticSrc, isLink}) => (classname( computedClass: ({ className, src, staticSrc, isLink }) => (classname(
className, className,
src !== staticSrc && 'non-autoplay-zoom-in', src !== staticSrc && 'non-autoplay-zoom-in',
isLink && 'is-link' isLink && 'is-link'

View File

@ -73,7 +73,7 @@
pinnable: false pinnable: false
}), }),
computed: { computed: {
ariaLabel: ({label, pinnable, $pinnedPage, href}) => { ariaLabel: ({ label, pinnable, $pinnedPage, href }) => {
let res = label let res = label
if (pinnable) { if (pinnable) {
res += ' (' + ($pinnedPage === href ? 'Pinned page' : 'Unpinned page') + ')' res += ' (' + ($pinnedPage === href ? 'Pinned page' : 'Unpinned page') + ')'
@ -90,7 +90,7 @@
let { currentInstance, pinnedPages } = this.store.get() let { currentInstance, pinnedPages } = this.store.get()
let { href } = this.get() let { href } = this.get()
pinnedPages[currentInstance] = href pinnedPages[currentInstance] = href
this.store.set({pinnedPages: pinnedPages}) this.store.set({ pinnedPages: pinnedPages })
this.store.save() this.store.save()
} }
} }

View File

@ -59,7 +59,7 @@
]) ])
} }
}).then(() => { }).then(() => {
this.set({shown: shouldBeShown}) this.set({ shown: shouldBeShown })
}) })
}) })
}, },

View File

@ -231,7 +231,7 @@
}, },
setupStickyObserver () { setupStickyObserver () {
this.__stickyObserver = new IntersectionObserver(entries => { this.__stickyObserver = new IntersectionObserver(entries => {
this.set({sticky: !entries[0].isIntersecting}) this.set({ sticky: !entries[0].isIntersecting })
}) })
this.__stickyObserver.observe(this.refs.sentinel) this.__stickyObserver.observe(this.refs.sentinel)
@ -241,12 +241,12 @@
this.observe('timelineInitialized', timelineInitialized => { this.observe('timelineInitialized', timelineInitialized => {
if (timelineInitialized) { if (timelineInitialized) {
let observer = new IntersectionObserver(entries => { let observer = new IntersectionObserver(entries => {
this.set({sticky: !entries[0].isIntersecting}) this.set({ sticky: !entries[0].isIntersecting })
observer.disconnect() observer.disconnect()
}) })
observer.observe(this.refs.sentinel) observer.observe(this.refs.sentinel)
} }
}, {init: false}) }, { init: false })
}, },
teardownStickyObserver () { teardownStickyObserver () {
if (this.__stickyObserver) { if (this.__stickyObserver) {

View File

@ -32,7 +32,7 @@
observe, observe,
setupSyncFromStore () { setupSyncFromStore () {
this.observe('contentWarning', contentWarning => { this.observe('contentWarning', contentWarning => {
this.set({rawText: contentWarning}) this.set({ rawText: contentWarning })
}) })
}, },
setupSyncToStore () { setupSyncToStore () {
@ -44,7 +44,7 @@
contentWarning: rawText contentWarning: rawText
}) })
saveText() saveText()
}, {init: false}) }, { init: false })
} }
} }
} }

View File

@ -56,7 +56,7 @@
this.observe('text', text => { this.observe('text', text => {
let { rawText } = this.get() let { rawText } = this.get()
if (rawText !== text) { if (rawText !== text) {
this.set({rawText: text}) this.set({ rawText: text })
// this next autosize is required to resize after // this next autosize is required to resize after
// the user clicks the "toot" button // the user clicks the "toot" button
mark('autosize.update()') mark('autosize.update()')
@ -78,10 +78,10 @@
this.observe('rawText', rawText => { this.observe('rawText', rawText => {
mark('observe rawText') mark('observe rawText')
let { realm } = this.get() let { realm } = this.get()
this.store.setComposeData(realm, {text: rawText}) this.store.setComposeData(realm, { text: rawText })
saveStore() saveStore()
stop('observe rawText') stop('observe rawText')
}, {init: false}) }, { init: false })
}, },
setupAutosize () { setupAutosize () {
let textarea = this.refs.textarea let textarea = this.refs.textarea
@ -98,19 +98,19 @@
}, },
onBlur () { onBlur () {
scheduleIdleTask(() => { scheduleIdleTask(() => {
this.store.setForCurrentAutosuggest({composeFocused: false}) this.store.setForCurrentAutosuggest({ composeFocused: false })
}) })
}, },
onFocus () { onFocus () {
scheduleIdleTask(() => { scheduleIdleTask(() => {
let {realm} = this.get() let { realm } = this.get()
this.store.set({currentComposeRealm: realm}) this.store.set({ currentComposeRealm: realm })
this.store.setForCurrentAutosuggest({composeFocused: true}) this.store.setForCurrentAutosuggest({ composeFocused: true })
}) })
}, },
onSelectionChange (selectionStart) { onSelectionChange (selectionStart) {
scheduleIdleTask(() => { scheduleIdleTask(() => {
this.store.setForCurrentAutosuggest({composeSelectionStart: selectionStart}) this.store.setForCurrentAutosuggest({ composeSelectionStart: selectionStart })
}) })
}, },
onKeydown (e) { onKeydown (e) {
@ -172,7 +172,7 @@
} else { } else {
autosuggestSelected = autosuggestSearchResults.length + autosuggestSelected autosuggestSelected = autosuggestSearchResults.length + autosuggestSelected
} }
this.store.setForCurrentAutosuggest({autosuggestSelected}) this.store.setForCurrentAutosuggest({ autosuggestSelected })
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
}, },

View File

@ -26,17 +26,17 @@
export default { export default {
oncreate () { oncreate () {
let { lengthAsFraction } = this.get() let { lengthAsFraction } = this.get()
this.set({lengthAsFractionDeferred: lengthAsFraction}) this.set({ lengthAsFractionDeferred: lengthAsFraction })
// perf improvement for keyboard input latency // perf improvement for keyboard input latency
this.observe('lengthAsFraction', () => { this.observe('lengthAsFraction', () => {
scheduleIdleTask(() => { scheduleIdleTask(() => {
mark('set lengthAsFractionDeferred') mark('set lengthAsFractionDeferred')
let { lengthAsFraction } = this.get() let { lengthAsFraction } = this.get()
this.set({lengthAsFractionDeferred: lengthAsFraction}) this.set({ lengthAsFractionDeferred: lengthAsFraction })
stop('set lengthAsFractionDeferred') stop('set lengthAsFractionDeferred')
requestAnimationFrame(() => this.set({shouldAnimate: true})) requestAnimationFrame(() => this.set({ shouldAnimate: true }))
}) })
}, {init: false}) }, { init: false })
}, },
data: () => ({ data: () => ({
shouldAnimate: false, shouldAnimate: false,

View File

@ -24,16 +24,16 @@
export default { export default {
oncreate () { oncreate () {
let { lengthToDisplay } = this.get() let { lengthToDisplay } = this.get()
this.set({lengthToDisplayDeferred: lengthToDisplay}) this.set({ lengthToDisplayDeferred: lengthToDisplay })
// perf improvement for keyboard input latency // perf improvement for keyboard input latency
this.observe('lengthToDisplay', () => { this.observe('lengthToDisplay', () => {
scheduleIdleTask(() => { scheduleIdleTask(() => {
mark('set lengthToDisplayDeferred') mark('set lengthToDisplayDeferred')
let { lengthToDisplay } = this.get() let { lengthToDisplay } = this.get()
this.set({lengthToDisplayDeferred: lengthToDisplay}) this.set({ lengthToDisplayDeferred: lengthToDisplay })
stop('set lengthToDisplayDeferred') stop('set lengthToDisplayDeferred')
}) })
}, {init: false}) }, { init: false })
}, },
data: () => ({ data: () => ({
lengthToDisplayDeferred: 0 lengthToDisplayDeferred: 0

View File

@ -100,7 +100,7 @@
let { index, rawText } = this.get() let { index, rawText } = this.get()
let text = (media[index] && media[index].description) || '' let text = (media[index] && media[index].description) || ''
if (rawText !== text) { if (rawText !== text) {
this.set({rawText: text}) this.set({ rawText: text })
} }
}) })
}, },
@ -113,9 +113,9 @@
return return
} }
media[index].description = rawText media[index].description = rawText
store.setComposeData(realm, {media}) store.setComposeData(realm, { media })
saveStore() saveStore()
}, {init: false}) }, { init: false })
}, },
onDeleteMedia () { onDeleteMedia () {
let { let {

View File

@ -68,7 +68,7 @@
} }
}, },
onPositive () { onPositive () {
this.set({positiveResult: true}) this.set({ positiveResult: true })
this.close() this.close()
}, },
onNegative () { onNegative () {

View File

@ -24,11 +24,11 @@ import { copyText } from '../../../_actions/copyText'
export default { export default {
oncreate, oncreate,
computed: { computed: {
relationship: ({$currentAccountRelationship}) => $currentAccountRelationship, relationship: ({ $currentAccountRelationship }) => $currentAccountRelationship,
account: ({$currentAccountProfile}) => $currentAccountProfile, account: ({ $currentAccountProfile }) => $currentAccountProfile,
verifyCredentials: ({$currentVerifyCredentials}) => $currentVerifyCredentials, verifyCredentials: ({ $currentVerifyCredentials }) => $currentVerifyCredentials,
statusId: ({status}) => status.id, statusId: ({ status }) => status.id,
pinned: ({statusId, $currentStatusModifications, status}) => { pinned: ({ statusId, $currentStatusModifications, status }) => {
if ($currentStatusModifications && statusId in $currentStatusModifications.pins) { if ($currentStatusModifications && statusId in $currentStatusModifications.pins) {
return $currentStatusModifications.pins[statusId] return $currentStatusModifications.pins[statusId]
} }
@ -37,14 +37,14 @@ export default {
// //
// begin copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html) // begin copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html)
// //
verifyCredentialsId: ({verifyCredentials}) => verifyCredentials.id, verifyCredentialsId: ({ verifyCredentials }) => verifyCredentials.id,
following: ({relationship}) => relationship && relationship.following, following: ({ relationship }) => relationship && relationship.following,
followRequested: ({relationship}) => relationship && relationship.requested, followRequested: ({ relationship }) => relationship && relationship.requested,
accountId: ({account}) => account && account.id, accountId: ({ account }) => account && account.id,
acct: ({account}) => account.acct, acct: ({ account }) => account.acct,
muting: ({relationship}) => relationship.muting, muting: ({ relationship }) => relationship.muting,
blocking: ({relationship}) => relationship.blocking, blocking: ({ relationship }) => relationship.blocking,
followLabel: ({following, followRequested, account, acct}) => { followLabel: ({ following, followRequested, account, acct }) => {
if (typeof following === 'undefined' || !account) { if (typeof following === 'undefined' || !account) {
return '' return ''
} }
@ -52,28 +52,28 @@ export default {
? `Unfollow @${acct}` ? `Unfollow @${acct}`
: `Follow @${acct}` : `Follow @${acct}`
}, },
followIcon: ({following, followRequested}) => ( followIcon: ({ following, followRequested }) => (
following ? '#fa-user-times' : followRequested ? '#fa-hourglass' : '#fa-user-plus' following ? '#fa-user-times' : followRequested ? '#fa-hourglass' : '#fa-user-plus'
), ),
blockLabel: ({blocking, acct}) => ( blockLabel: ({ blocking, acct }) => (
blocking ? `Unblock @${acct}` : `Block @${acct}` blocking ? `Unblock @${acct}` : `Block @${acct}`
), ),
blockIcon: ({blocking}) => blocking ? '#fa-unlock' : '#fa-ban', blockIcon: ({ blocking }) => blocking ? '#fa-unlock' : '#fa-ban',
muteLabel: ({muting, acct}) => ( muteLabel: ({ muting, acct }) => (
muting ? `Unmute @${acct}` : `Mute @${acct}` muting ? `Unmute @${acct}` : `Mute @${acct}`
), ),
muteIcon: ({muting}) => muting ? '#fa-volume-up' : '#fa-volume-off', muteIcon: ({ muting }) => muting ? '#fa-volume-up' : '#fa-volume-off',
isUser: ({accountId, verifyCredentialsId}) => accountId === verifyCredentialsId, isUser: ({ accountId, verifyCredentialsId }) => accountId === verifyCredentialsId,
// //
// end copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html) // end copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html)
// //
pinLabel: ({pinned, isUser}) => isUser ? (pinned ? 'Unpin from profile' : 'Pin to profile') : '', pinLabel: ({ pinned, isUser }) => isUser ? (pinned ? 'Unpin from profile' : 'Pin to profile') : '',
visibility: ({status}) => status.visibility, visibility: ({ status }) => status.visibility,
mentions: ({status}) => status.mentions || [], mentions: ({ status }) => status.mentions || [],
mentionsUser: ({mentions, verifyCredentialsId}) => !!mentions.find(_ => _.id === verifyCredentialsId), mentionsUser: ({ mentions, verifyCredentialsId }) => !!mentions.find(_ => _.id === verifyCredentialsId),
mutingConversation: ({status}) => !!status.muted, mutingConversation: ({ status }) => !!status.muted,
muteConversationLabel: ({mutingConversation}) => mutingConversation ? `Unmute conversation` : `Mute conversation`, muteConversationLabel: ({ mutingConversation }) => mutingConversation ? `Unmute conversation` : `Mute conversation`,
muteConversationIcon: ({mutingConversation}) => mutingConversation ? '#fa-volume-up' : '#fa-volume-off', muteConversationIcon: ({ mutingConversation }) => mutingConversation ? '#fa-volume-up' : '#fa-volume-off',
items: ({ items: ({
blockLabel, blocking, blockIcon, muteLabel, muteIcon, followLabel, followIcon, blockLabel, blocking, blockIcon, muteLabel, muteIcon, followLabel, followIcon,
following, followRequested, pinLabel, isUser, visibility, mentionsUser, mutingConversation, following, followRequested, pinLabel, isUser, visibility, mentionsUser, mutingConversation,

View File

@ -31,7 +31,7 @@
itemInitialized () { itemInitialized () {
let { initializedCount, length } = this.get() let { initializedCount, length } = this.get()
initializedCount++ initializedCount++
this.set({initializedCount}) this.set({ initializedCount })
if (initializedCount === length) { if (initializedCount === length) {
this.initialize() this.initialize()
} }

View File

@ -18,7 +18,7 @@
if (makeProps) { if (makeProps) {
let props = await makeProps(key) let props = await makeProps(key)
mark('ListLazyItem set props') mark('ListLazyItem set props')
this.set({props: props}) this.set({ props: props })
this.fire('initialized') this.fire('initialized')
stop('ListLazyItem set props') stop('ListLazyItem set props')
} }

View File

@ -43,7 +43,7 @@
} else { // follow/unfollow } else { // follow/unfollow
let newFollowingValue = !(following || followRequested) let newFollowingValue = !(following || followRequested)
if (!account.locked) { // be optimistic, show the user that it succeeded if (!account.locked) { // be optimistic, show the user that it succeeded
this.set({overrideFollowing: newFollowingValue}) this.set({ overrideFollowing: newFollowingValue })
} }
if (newFollowingValue) { if (newFollowingValue) {
this.refs.icon.animate(FOLLOW_BUTTON_ANIMATION) this.refs.icon.animate(FOLLOW_BUTTON_ANIMATION)

View File

@ -128,7 +128,7 @@
scheduleIdleTask(() => { scheduleIdleTask(() => {
// Perf optimization: lazily load the StatusContent when the user is idle so that // Perf optimization: lazily load the StatusContent when the user is idle so that
// it's fast when they click the "show more" button // it's fast when they click the "show more" button
this.set({contentPreloaded: true}) this.set({ contentPreloaded: true })
}) })
} }
}, },

View File

@ -45,7 +45,7 @@
let { uuid } = this.get() let { uuid } = this.get()
let { repliesShown } = this.store.get() let { repliesShown } = this.store.get()
repliesShown[uuid] = false repliesShown[uuid] = false
this.store.set({repliesShown}) this.store.set({ repliesShown })
this.fire('recalculateHeight') this.fire('recalculateHeight')
}) })
}, },

View File

@ -148,7 +148,7 @@
let { uuid } = this.get() let { uuid } = this.get()
let { sensitivesShown } = this.store.get() let { sensitivesShown } = this.store.get()
sensitivesShown[uuid] = !sensitivesShown[uuid] sensitivesShown[uuid] = !sensitivesShown[uuid]
this.store.set({sensitivesShown}) this.store.set({ sensitivesShown })
this.fire('recalculateHeight') this.fire('recalculateHeight')
} }
} }

View File

@ -67,7 +67,7 @@
let { uuid } = this.get() let { uuid } = this.get()
let { spoilersShown } = this.store.get() let { spoilersShown } = this.store.get()
spoilersShown[uuid] = !spoilersShown[uuid] spoilersShown[uuid] = !spoilersShown[uuid]
this.store.set({spoilersShown}) this.store.set({ spoilersShown })
this.fire('recalculateHeight') this.fire('recalculateHeight')
stop('clickSpoilerButton') stop('clickSpoilerButton')
}) })

View File

@ -107,7 +107,7 @@
let { uuid } = this.get() let { uuid } = this.get()
let { repliesShown } = this.store.get() let { repliesShown } = this.store.get()
repliesShown[uuid] = !repliesShown[uuid] repliesShown[uuid] = !repliesShown[uuid]
this.store.set({repliesShown}) this.store.set({ repliesShown })
this.fire('recalculateHeight') this.fire('recalculateHeight')
}) })
}, },

View File

@ -20,8 +20,8 @@
oncreate () { oncreate () {
let { currentInstance } = this.store.get() let { currentInstance } = this.store.get()
let { timeline } = this.get() let { timeline } = this.get()
this.store.set({currentTimeline: timeline}) this.store.set({ currentTimeline: timeline })
this.store.setForTimeline(currentInstance, timeline, {runningUpdate: false}) this.store.setForTimeline(currentInstance, timeline, { runningUpdate: false })
}, },
store: () => store, store: () => store,
data: () => ({ data: () => ({

View File

@ -154,16 +154,16 @@
if (initializeStarted) { if (initializeStarted) {
return return
} }
this.set({initializeStarted: true}) this.set({ initializeStarted: true })
mark('initializeTimeline') mark('initializeTimeline')
doubleRAF(() => { doubleRAF(() => {
console.log('timeline initialized') console.log('timeline initialized')
this.store.set({timelineInitialized: true}) this.store.set({ timelineInitialized: true })
stop('initializeTimeline') stop('initializeTimeline')
}) })
}, },
onScrollTopChanged (scrollTop) { onScrollTopChanged (scrollTop) {
this.set({scrollTop: scrollTop}) this.set({ scrollTop: scrollTop })
}, },
onScrollToBottom () { onScrollToBottom () {
let { timelineType } = this.get() let { timelineType } = this.get()
@ -212,7 +212,7 @@
showMoreItemsForTimeline(currentInstance, timeline) showMoreItemsForTimeline(currentInstance, timeline)
} else { } else {
// user hasn't scrolled to the top, show a header instead // user hasn't scrolled to the top, show a header instead
this.store.setForTimeline(currentInstance, timeline, {shouldShowHeader: true}) this.store.setForTimeline(currentInstance, timeline, { shouldShowHeader: true })
} }
stop('handleItemIdsToAdd') stop('handleItemIdsToAdd')
} }
@ -294,7 +294,7 @@
// i.e. render anything above the fold of the timeline. This avoids the affect // i.e. render anything above the fold of the timeline. This avoids the affect
// where the scrollable content appears to jump around if we need to scroll it. // where the scrollable content appears to jump around if we need to scroll it.
console.log('timeline preinitialized') console.log('timeline preinitialized')
this.store.set({timelinePreinitialized: true}) this.store.set({ timelinePreinitialized: true })
} }
} }
} }

View File

@ -47,12 +47,12 @@
}, SCROLL_EVENT_THROTTLE) }, SCROLL_EVENT_THROTTLE)
this.observe('showFooter', showFooter => { this.observe('showFooter', showFooter => {
mark('set showFooter') mark('set showFooter')
this.store.setForRealm({showFooter: showFooter}) this.store.setForRealm({ showFooter: showFooter })
mark('set showFooter') mark('set showFooter')
}) })
this.observe('showHeader', showHeader => { this.observe('showHeader', showHeader => {
mark('set showHeader') mark('set showHeader')
this.store.setForRealm({showHeader: showHeader}) this.store.setForRealm({ showHeader: showHeader })
stop('set showHeader') stop('set showHeader')
}) })
this.observe('items', (newItems, oldItems) => { this.observe('items', (newItems, oldItems) => {
@ -60,7 +60,7 @@
return return
} }
mark('set items') mark('set items')
this.store.setForRealm({items: newItems}) this.store.setForRealm({ items: newItems })
stop('set items') stop('set items')
}) })
this.observe('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight => { this.observe('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight => {
@ -118,7 +118,7 @@
} }
mark('calculateListOffset') mark('calculateListOffset')
let listOffset = node.offsetParent.offsetTop let listOffset = node.offsetParent.offsetTop
this.store.setForRealm({listOffset}) this.store.setForRealm({ listOffset })
stop('calculateListOffset') stop('calculateListOffset')
} }
} }

View File

@ -26,7 +26,7 @@
console.log('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight) console.log('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight)
let { initializedScrollTop } = this.get() let { initializedScrollTop } = this.get()
if (!initializedScrollTop && allVisibleItemsHaveHeight && node) { if (!initializedScrollTop && allVisibleItemsHaveHeight && node) {
this.set({'initializedScrollTop': true}) this.set({ 'initializedScrollTop': true })
mark('set scrollTop') mark('set scrollTop')
console.log('forcing scroll top to ', scrollTop) console.log('forcing scroll top to ', scrollTop)
node.scrollTop = scrollTop node.scrollTop = scrollTop
@ -95,7 +95,7 @@
doubleRAF(() => { doubleRAF(() => {
mark('onScroll -> setForRealm()') mark('onScroll -> setForRealm()')
this.store.setForRealm({scrollTop, scrollHeight}) this.store.setForRealm({ scrollTop, scrollHeight })
stop('onScroll -> setForRealm()') stop('onScroll -> setForRealm()')
}) })
}, },

View File

@ -25,7 +25,7 @@
mark('VirtualListFooter gBCR') mark('VirtualListFooter gBCR')
let rect = node.getBoundingClientRect() let rect = node.getBoundingClientRect()
stop('VirtualListFooter gBCR') stop('VirtualListFooter gBCR')
this.store.setForRealm({footerHeight: rect.height}) this.store.setForRealm({ footerHeight: rect.height })
}) })
}, },
store: () => virtualListStore store: () => virtualListStore

View File

@ -31,11 +31,11 @@
this.observe('shown', shown => { this.observe('shown', shown => {
if (shown) { if (shown) {
this.doCalculateHeight() this.doCalculateHeight()
doubleRAF(() => this.set({fadedIn: true})) // animate in doubleRAF(() => this.set({ fadedIn: true })) // animate in
} else { } else {
this.set({fadedIn: false}) this.set({ fadedIn: false })
} }
}, {init: false}) }, { init: false })
}, },
data: () => ({ data: () => ({
fadedIn: false fadedIn: false
@ -48,12 +48,12 @@
if (heightCalculated) { // only need to calculate once, it never changes if (heightCalculated) { // only need to calculate once, it never changes
return return
} }
this.set({heightCalculated: true}) this.set({ heightCalculated: true })
requestAnimationFrame(() => { requestAnimationFrame(() => {
mark('VirtualListHeader gBCR') mark('VirtualListHeader gBCR')
let rect = this.refs.node.getBoundingClientRect() let rect = this.refs.node.getBoundingClientRect()
stop('VirtualListHeader gBCR') stop('VirtualListHeader gBCR')
this.store.setForRealm({headerHeight: rect.height}) this.store.setForRealm({ headerHeight: rect.height })
}) })
} }
} }

View File

@ -59,7 +59,7 @@
let { key } = this.get() let { key } = this.get()
let { itemHeights } = this.store.get() let { itemHeights } = this.store.get()
itemHeights[key] = rect.height itemHeights[key] = rect.height
this.store.setForRealm({itemHeights}) this.store.setForRealm({ itemHeights })
} }
} }
} }

View File

@ -16,7 +16,7 @@
if (makeProps) { if (makeProps) {
let props = await makeProps(key) let props = await makeProps(key)
mark('VirtualListLazyItem set props') mark('VirtualListLazyItem set props')
this.set({props: props}) this.set({ props: props })
stop('VirtualListLazyItem set props') stop('VirtualListLazyItem set props')
} }
}, },

View File

@ -106,7 +106,7 @@ virtualListStore.compute('allVisibleItemsHaveHeight',
if (process.browser && process.env.NODE_ENV !== 'production') { if (process.browser && process.env.NODE_ENV !== 'production') {
window.virtualListStore = virtualListStore window.virtualListStore = virtualListStore
virtualListStore.on('state', ({changed}) => { virtualListStore.on('state', ({ changed }) => {
if (changed.visibleItems) { if (changed.visibleItems) {
window.visibleItemsChangedCount = (window.visibleItemsChangedCount || 0) + 1 window.visibleItemsChangedCount = (window.visibleItemsChangedCount || 0) + 1
} }

View File

@ -34,7 +34,7 @@ if (process.browser && process.env.NODE_ENV !== 'production') {
function getOrCreateInstanceCache (cache, instanceName) { function getOrCreateInstanceCache (cache, instanceName) {
let cached = cache.caches[instanceName] let cached = cache.caches[instanceName]
if (!cached) { if (!cached) {
cached = cache.caches[instanceName] = new QuickLRU({maxSize: cache.maxSize}) cached = cache.caches[instanceName] = new QuickLRU({ maxSize: cache.maxSize })
} }
return cached return cached
} }

View File

@ -53,24 +53,24 @@ export function getDatabase (instanceName) {
} }
if (e.oldVersion < DB_VERSION_INITIAL) { if (e.oldVersion < DB_VERSION_INITIAL) {
createObjectStore(STATUSES_STORE, {keyPath: 'id'}, { createObjectStore(STATUSES_STORE, { keyPath: 'id' }, {
[TIMESTAMP]: TIMESTAMP, [TIMESTAMP]: TIMESTAMP,
[REBLOG_ID]: REBLOG_ID [REBLOG_ID]: REBLOG_ID
}) })
createObjectStore(STATUS_TIMELINES_STORE, null, { createObjectStore(STATUS_TIMELINES_STORE, null, {
'statusId': '' 'statusId': ''
}) })
createObjectStore(NOTIFICATIONS_STORE, {keyPath: 'id'}, { createObjectStore(NOTIFICATIONS_STORE, { keyPath: 'id' }, {
[TIMESTAMP]: TIMESTAMP, [TIMESTAMP]: TIMESTAMP,
[STATUS_ID]: STATUS_ID [STATUS_ID]: STATUS_ID
}) })
createObjectStore(NOTIFICATION_TIMELINES_STORE, null, { createObjectStore(NOTIFICATION_TIMELINES_STORE, null, {
'notificationId': '' 'notificationId': ''
}) })
createObjectStore(ACCOUNTS_STORE, {keyPath: 'id'}, { createObjectStore(ACCOUNTS_STORE, { keyPath: 'id' }, {
[TIMESTAMP]: TIMESTAMP [TIMESTAMP]: TIMESTAMP
}) })
createObjectStore(RELATIONSHIPS_STORE, {keyPath: 'id'}, { createObjectStore(RELATIONSHIPS_STORE, { keyPath: 'id' }, {
[TIMESTAMP]: TIMESTAMP [TIMESTAMP]: TIMESTAMP
}) })
createObjectStore(THREADS_STORE, null, { createObjectStore(THREADS_STORE, null, {

View File

@ -47,7 +47,7 @@
} catch (e) { } catch (e) {
toast.say('Error: ' + (e.name || '') + ' ' + (e.message || '')) toast.say('Error: ' + (e.name || '') + ' ' + (e.message || ''))
} finally { } finally {
this.set({loading: false}) this.set({ loading: false })
} }
}, },
data: () => ({ data: () => ({

View File

@ -1,9 +1,9 @@
export const FAVORITE_ANIMATION = [ export const FAVORITE_ANIMATION = [
{ {
properties: [ properties: [
{transform: 'scale(1)'}, { transform: 'scale(1)' },
{transform: 'scale(2)'}, { transform: 'scale(2)' },
{transform: 'scale(1)'} { transform: 'scale(1)' }
], ],
options: { options: {
duration: 333, duration: 333,
@ -12,8 +12,8 @@ export const FAVORITE_ANIMATION = [
}, },
{ {
properties: [ properties: [
{fill: 'var(--action-button-fill-color)'}, { fill: 'var(--action-button-fill-color)' },
{fill: 'var(--action-button-fill-color-pressed)'} { fill: 'var(--action-button-fill-color-pressed)' }
], ],
options: { options: {
duration: 333, duration: 333,
@ -27,9 +27,9 @@ export const REBLOG_ANIMATION = FAVORITE_ANIMATION
export const FOLLOW_BUTTON_ANIMATION = [ export const FOLLOW_BUTTON_ANIMATION = [
{ {
properties: [ properties: [
{transform: 'scale(1)'}, { transform: 'scale(1)' },
{transform: 'scale(2)'}, { transform: 'scale(2)' },
{transform: 'scale(1)'} { transform: 'scale(1)' }
], ],
options: { options: {
duration: 333, duration: 333,

View File

@ -27,7 +27,7 @@ export class LocalStorageStore extends Store {
} }
} }
this.set(newState) this.set(newState)
this.on('state', ({changed}) => { this.on('state', ({ changed }) => {
Object.keys(changed).forEach(change => { Object.keys(changed).forEach(change => {
if (this._keysToWatch.has(change)) { if (this._keysToWatch.has(change)) {
this._keysToSave[change] = true this._keysToSave[change] = true

View File

@ -3,7 +3,7 @@ export function instanceMixins (Store) {
let { composeData, currentInstance } = this.get() let { composeData, currentInstance } = this.get()
let instanceNameData = composeData[currentInstance] = composeData[currentInstance] || {} let instanceNameData = composeData[currentInstance] = composeData[currentInstance] || {}
instanceNameData[realm] = Object.assign(instanceNameData[realm] || {}, obj) instanceNameData[realm] = Object.assign(instanceNameData[realm] || {}, obj)
this.set({composeData}) this.set({ composeData })
} }
Store.prototype.getComposeData = function (realm, key) { Store.prototype.getComposeData = function (realm, key) {
@ -18,6 +18,6 @@ export function instanceMixins (Store) {
if (composeData && composeData[currentInstance]) { if (composeData && composeData[currentInstance]) {
delete composeData[currentInstance][realm] delete composeData[currentInstance][realm]
} }
this.set({composeData}) this.set({ composeData })
} }
} }

View File

@ -34,6 +34,6 @@ export function onlineObservers (store) {
} }
}) })
window.addEventListener('offline', () => store.set({online: false})) window.addEventListener('offline', () => store.set({ online: false }))
window.addEventListener('online', () => store.set({online: true})) window.addEventListener('online', () => store.set({ online: true }))
} }

View File

@ -4,6 +4,6 @@ export function pageVisibilityObservers (store) {
} }
document.addEventListener('visibilitychange', () => { document.addEventListener('visibilitychange', () => {
store.set({pageVisibilityHidden: document.hidden}) store.set({ pageVisibilityHidden: document.hidden })
}) })
} }

View File

@ -6,7 +6,7 @@ export function resizeObservers (store) {
} }
const recalculateIsMobileSize = () => { const recalculateIsMobileSize = () => {
store.set({isMobileSize: window.matchMedia('(max-width: 767px)').matches}) store.set({ isMobileSize: window.matchMedia('(max-width: 767px)').matches })
} }
registerResizeListener(recalculateIsMobileSize) registerResizeListener(recalculateIsMobileSize)

View File

@ -21,11 +21,11 @@ export function timelineObservers (store) {
function shouldObserveTimeline (timeline) { function shouldObserveTimeline (timeline) {
return timeline && return timeline &&
!( !(
timeline !== 'local' && timeline !== 'local' &&
timeline !== 'federated' && timeline !== 'federated' &&
!timeline.startsWith('list/') && !timeline.startsWith('list/') &&
!timeline.startsWith('tag/') !timeline.startsWith('tag/')
) )
} }
store.observe('currentTimeline', async (currentTimeline) => { store.observe('currentTimeline', async (currentTimeline) => {

View File

@ -62,5 +62,5 @@ if (process.browser && process.env.NODE_ENV !== 'production') {
// needed for tests // needed for tests
if (process.browser) { if (process.browser) {
window.__forceOnline = online => store.set({online}) window.__forceOnline = online => store.set({ online })
} }

View File

@ -8,18 +8,18 @@ import { mark, stop } from './marks'
export class RealmStore extends Store { export class RealmStore extends Store {
constructor (init, maxSize) { constructor (init, maxSize) {
super(init) super(init)
this.set({realms: new QuickLRU({maxSize: maxSize})}) this.set({ realms: new QuickLRU({ maxSize: maxSize }) })
this._batches = {} this._batches = {}
} }
setCurrentRealm (realm) { setCurrentRealm (realm) {
this.set({currentRealm: realm}) this.set({ currentRealm: realm })
} }
setForRealm (obj) { setForRealm (obj) {
let { currentRealm, realms } = this.get() let { currentRealm, realms } = this.get()
realms.set(currentRealm, Object.assign(realms.get(currentRealm) || {}, obj)) realms.set(currentRealm, Object.assign(realms.get(currentRealm) || {}, obj))
this.set({realms: realms}) this.set({ realms: realms })
} }
computeForRealm (key, defaultValue) { computeForRealm (key, defaultValue) {
@ -63,8 +63,8 @@ export class RealmStore extends Store {
} }
delete this._batches[currentRealm][key] delete this._batches[currentRealm][key]
let { realms } = this.get() let { realms } = this.get()
realms.set(currentRealm, Object.assign(realms.get(currentRealm) || {}, {[key]: obj})) realms.set(currentRealm, Object.assign(realms.get(currentRealm) || {}, { [key]: obj }))
this.set({realms: realms}) this.set({ realms: realms })
stop('batchUpdate') stop('batchUpdate')
}) })
} }

View File

@ -8,7 +8,7 @@ import debounce from 'lodash-es/debounce'
import throttle from 'lodash-es/throttle' import throttle from 'lodash-es/throttle'
const map = new Map() const map = new Map()
let createEvent = (name) => new Event(name, {bubbles: true}) let createEvent = (name) => new Event(name, { bubbles: true })
function assign (ta) { function assign (ta) {
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) { if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) {

View File

@ -40,7 +40,7 @@ export function registerClickDelegates (component, delegates) {
} }
export function registerClickDelegate (component, key, callback) { export function registerClickDelegate (component, key, callback) {
registerClickDelegates(component, {[key]: callback}) registerClickDelegates(component, { [key]: callback })
} }
if (process.browser) { if (process.browser) {

View File

@ -17,7 +17,7 @@ export function reselect (store, outputKey, inputKey) {
store.compute(countKey, [inputKey], input => { store.compute(countKey, [inputKey], input => {
if (process.browser && process.env.NODE_ENV !== 'production') { if (process.browser && process.env.NODE_ENV !== 'production') {
window.reselectStats[inputKey] = window.reselectStats[inputKey] || {numInputChanges: 0, numOutputChanges: 0} window.reselectStats[inputKey] = window.reselectStats[inputKey] || { numInputChanges: 0, numOutputChanges: 0 }
window.reselectStats[inputKey].numInputChanges++ window.reselectStats[inputKey].numInputChanges++
} }
if (!isEqual(prevValue, input)) { if (!isEqual(prevValue, input)) {

View File

@ -36,8 +36,8 @@ const scroll = (node, key, target) => {
node.removeEventListener('touchstart', cancel) node.removeEventListener('touchstart', cancel)
} }
node.addEventListener('wheel', cancel, {passive: true}) node.addEventListener('wheel', cancel, { passive: true })
node.addEventListener('touchstart', cancel, {passive: true}) node.addEventListener('touchstart', cancel, { passive: true })
step() step()

View File

@ -28,7 +28,7 @@ const nonDebugOnly = (fn) => (req, res, next) => (
~debugPaths.indexOf(req.path) ? next() : fn(req, res, next) ~debugPaths.indexOf(req.path) ? next() : fn(req, res, next)
) )
app.use(shrinkRay({threshold: 0})) app.use(shrinkRay({ threshold: 0 }))
// report.html needs to have CSP disable because it has inline scripts // report.html needs to have CSP disable because it has inline scripts
app.use(debugOnly(helmet())) app.use(debugOnly(helmet()))

View File

@ -11,5 +11,5 @@ export function base64StringToBlob (base64, type) {
} }
let parts = [binaryStringToArrayBuffer(atob(base64))] let parts = [binaryStringToArrayBuffer(atob(base64))]
return type ? new Blob(parts, {type: type}) : new Blob(parts) return type ? new Blob(parts, { type: type }) : new Blob(parts)
} }

View File

@ -1,89 +1,89 @@
import { times } from './utils' import { times } from './utils'
export const homeTimeline = [ export const homeTimeline = [
{content: 'pinned toot 1'}, { content: 'pinned toot 1' },
{content: 'notification of unlisted message'}, { content: 'notification of unlisted message' },
{content: 'notification of followers-only message'}, { content: 'notification of followers-only message' },
{content: 'notification of direct message'}, { content: 'notification of direct message' },
{content: 'this is unlisted'}, { content: 'this is unlisted' },
{content: 'this is followers-only'}, { content: 'this is followers-only' },
{content: 'direct'}, { content: 'direct' },
{spoiler: 'kitten CW'}, { spoiler: 'kitten CW' },
{content: 'secret video'}, { content: 'secret video' },
{content: "here's a video"}, { content: "here's a video" },
{spoiler: 'CW'}, { spoiler: 'CW' },
{content: "here's a secret animated kitten gif"}, { content: "here's a secret animated kitten gif" },
{content: "here's an animated kitten gif"}, { content: "here's an animated kitten gif" },
{content: "here's 2 kitten photos"}, { content: "here's 2 kitten photos" },
{content: "here's a secret kitten"}, { content: "here's a secret kitten" },
{content: "here's a kitten"}, { content: "here's a kitten" },
{content: 'hello admin'}, { content: 'hello admin' },
{content: 'hello foobar'}, { content: 'hello foobar' },
{content: 'hello world'} { content: 'hello world' }
].concat(times(30, i => ({content: (30 - i).toString()}))) ].concat(times(30, i => ({ content: (30 - i).toString() })))
export const localTimeline = [ export const localTimeline = [
{spoiler: 'kitten CW'}, { spoiler: 'kitten CW' },
{content: 'secret video'}, { content: 'secret video' },
{content: "here's a video"}, { content: "here's a video" },
{spoiler: 'CW'}, { spoiler: 'CW' },
{content: "here's a secret animated kitten gif"}, { content: "here's a secret animated kitten gif" },
{content: "here's an animated kitten gif"}, { content: "here's an animated kitten gif" },
{content: "here's 2 kitten photos"}, { content: "here's 2 kitten photos" },
{content: "here's a secret kitten"}, { content: "here's a secret kitten" },
{content: "here's a kitten"}, { content: "here's a kitten" },
{content: 'hello world'} { content: 'hello world' }
].concat(times(30, i => ({content: (30 - i).toString()}))) ].concat(times(30, i => ({ content: (30 - i).toString() })))
export const notifications = [ export const notifications = [
{favoritedBy: 'admin'}, { favoritedBy: 'admin' },
{rebloggedBy: 'admin'}, { rebloggedBy: 'admin' },
{content: 'notification of unlisted message'}, { content: 'notification of unlisted message' },
{content: 'notification of followers-only message'}, { content: 'notification of followers-only message' },
{content: 'notification of direct message'}, { content: 'notification of direct message' },
{followedBy: 'quux'}, { followedBy: 'quux' },
{content: 'hello foobar'}, { content: 'hello foobar' },
{followedBy: 'admin'} { followedBy: 'admin' }
] ]
export const favorites = [ export const favorites = [
{content: 'notification of direct message'}, { content: 'notification of direct message' },
{content: 'notification of followers-only message'}, { content: 'notification of followers-only message' },
{content: 'notification of unlisted message'}, { content: 'notification of unlisted message' },
{content: 'pinned toot 1'} { content: 'pinned toot 1' }
] ]
export const quuxStatuses = [ export const quuxStatuses = [
{content: 'pinned toot 2'}, { content: 'pinned toot 2' },
{content: 'pinned toot 1'} { content: 'pinned toot 1' }
].concat(times(25, i => ({content: `unlisted thread ${25 - i}`}))) ].concat(times(25, i => ({ content: `unlisted thread ${25 - i}` })))
export const quuxThread = times(25, i => ({content: `unlisted thread ${i + 1}`})) export const quuxThread = times(25, i => ({ content: `unlisted thread ${i + 1}` }))
export const bazThreadRelativeTo2B2 = [ export const bazThreadRelativeTo2B2 = [
{content: 'thread 1'}, { content: 'thread 1' },
{content: 'thread 2'}, { content: 'thread 2' },
{content: 'thread 2b'}, { content: 'thread 2b' },
{content: 'thread 2b2'}, { content: 'thread 2b2' },
{content: 'thread 2b2a'} { content: 'thread 2b2a' }
] ]
export const bazThreadRelativeTo2b = [ export const bazThreadRelativeTo2b = [
{content: 'thread 1'}, { content: 'thread 1' },
{content: 'thread 2'}, { content: 'thread 2' },
{content: 'thread 2b'}, { content: 'thread 2b' },
{content: 'thread 2b1'}, { content: 'thread 2b1' },
{content: 'thread 2b2'}, { content: 'thread 2b2' },
{content: 'thread 2b2a'} { content: 'thread 2b2a' }
] ]
export const bazThreadRelativeTo2 = [ export const bazThreadRelativeTo2 = [
{content: 'thread 1'}, { content: 'thread 1' },
{content: 'thread 2'}, { content: 'thread 2' },
{content: 'thread 2a'}, { content: 'thread 2a' },
{content: 'thread 2b'}, { content: 'thread 2b' },
{content: 'thread 2b1'}, { content: 'thread 2b1' },
{content: 'thread 2b2'}, { content: 'thread 2b2' },
{content: 'thread 2b2a'}, { content: 'thread 2b2a' },
{content: 'thread 2c'} { content: 'thread 2c' }
] ]

Some files were not shown because too many files have changed in this diff Show More