fix: use correct this.store format in all components (#827)

This commit is contained in:
Nolan Lawson 2018-12-17 11:28:31 -08:00 committed by GitHub
parent bf9ba22c35
commit 4ca5b4611f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -126,7 +126,7 @@
return return
} }
media[index].description = rawText media[index].description = rawText
store.setComposeData(realm, { media }) this.store.setComposeData(realm, { media })
saveStore() saveStore()
}, { init: false }) }, { init: false })
}, },

View File

@ -4,13 +4,14 @@
import { goto } from '../../../__sapper__/client' import { goto } from '../../../__sapper__/client'
export default { export default {
store: () => store,
oncreate () { oncreate () {
let accessToken = location.search.match(/accessToken=([^&]+)/)[1] let accessToken = location.search.match(/accessToken=([^&]+)/)[1]
let instanceName = location.search.match(/instanceName=([^&]+)/)[1] let instanceName = location.search.match(/instanceName=([^&]+)/)[1]
let { let {
loggedInInstances, loggedInInstances,
loggedInInstancesInOrder loggedInInstancesInOrder
} = store.get() } = this.store.get()
loggedInInstances[instanceName] = { loggedInInstances[instanceName] = {
access_token: accessToken access_token: accessToken
@ -20,12 +21,12 @@
loggedInInstancesInOrder.push(instanceName) loggedInInstancesInOrder.push(instanceName)
} }
store.set({ this.store.set({
currentInstance: instanceName, currentInstance: instanceName,
loggedInInstances, loggedInInstances,
loggedInInstancesInOrder loggedInInstancesInOrder
}) })
store.save() this.store.save()
goto('/') goto('/')
} }
} }