1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-11 09:45:24 +01:00
Pinafore-Web-Client-Frontend/routes/_components/Timeline.html
2018-01-10 20:45:02 -08:00

36 lines
911 B
HTML

<ul>
{{#each statuses as status}}
<Status :status />
{{/each}}
</ul>
<script>
import { store } from '../_utils/store'
import { getHomeTimeline } from '../_utils/mastodon'
import fixture from '../_utils/fixture.json'
import Status from './Status.html'
export default {
oncreate: async function () {
if (process.browser) {
let instanceData = this.store.get('currentOauthInstance')
if (!instanceData) {
return
}
let response = fixture
// let response = await (await getHomeTimeline(instanceData.instanceName, instanceData.access_token)).json()
if (process.env.NODE_ENV !== 'production') {
console.log(response)
}
this.set({'statuses': response})
}
},
data: () => ({
target: 'home',
statuses: []
}),
store: () => store,
components: {
Status
}
}
</script>