diff --git a/src/renderer/components/TimelineSpace/Local.vue b/src/renderer/components/TimelineSpace/Local.vue index d88124e5..c5effa98 100644 --- a/src/renderer/components/TimelineSpace/Local.vue +++ b/src/renderer/components/TimelineSpace/Local.vue @@ -15,7 +15,6 @@ export default { components: { Toot }, computed: { ...mapState({ - account: state => state.TimelineSpace.account, timeline: state => state.TimelineSpace.Local.timeline }) }, @@ -40,14 +39,14 @@ export default { methods: { async initialize () { try { - await this.$store.dispatch('TimelineSpace/Local/fetchLocalTimeline', this.account) + await this.$store.dispatch('TimelineSpace/Local/fetchLocalTimeline') } catch (err) { this.$message({ message: 'Could not fetch timeline', type: 'error' }) } - this.$store.dispatch('TimelineSpace/Local/startLocalStreaming', this.account) + this.$store.dispatch('TimelineSpace/Local/startLocalStreaming') }, updateToot (message) { this.$store.commit('TimelineSpace/Local/updateToot', message) diff --git a/src/renderer/store/TimelineSpace/Local.js b/src/renderer/store/TimelineSpace/Local.js index 38f17982..7bb50d48 100644 --- a/src/renderer/store/TimelineSpace/Local.js +++ b/src/renderer/store/TimelineSpace/Local.js @@ -31,12 +31,12 @@ const Local = { } }, actions: { - fetchLocalTimeline ({ commit }, account) { + fetchLocalTimeline ({ state, commit, rootState }) { return new Promise((resolve, reject) => { const client = new Mastodon( { - access_token: account.accessToken, - api_url: account.baseURL + '/api/v1' + access_token: rootState.TimelineSpace.account.accessToken, + api_url: rootState.TimelineSpace.account.baseURL + '/api/v1' } ) client.get('/timelines/public', { limit: 40, local: true }, (err, data, res) => { @@ -46,12 +46,12 @@ const Local = { }) }) }, - startLocalStreaming ({ commit }, account) { + startLocalStreaming ({ state, commit, rootState }) { ipcRenderer.on('update-start-local-streaming', (event, update) => { commit('appendTimeline', update) }) return new Promise((resolve, reject) => { - ipcRenderer.send('start-local-streaming', account) + ipcRenderer.send('start-local-streaming', rootState.TimelineSpace.account) ipcRenderer.once('error-start-local-streaming', (event, err) => { reject(err) })