diff --git a/src/components/AddColumn/PublicTimeline.vue b/src/components/AddColumn/PublicTimeline.vue index 9f51db58..970eb590 100644 --- a/src/components/AddColumn/PublicTimeline.vue +++ b/src/components/AddColumn/PublicTimeline.vue @@ -11,7 +11,8 @@
- {{value}} + {{value.name}} +
{{status.id}}
import { ipcRenderer } from 'electron' import { Component, Vue } from 'vue-property-decorator' +import { Status } from 'megalodon' type Instance = string type showInput = boolean -type Timelines = string[] +type Timeline = { + name: string + statuses: Status[] +} +type Timelines = Timeline[] @Component export default class AddColumn extends Vue { public instance: Instance = '' @@ -44,13 +50,16 @@ export default class AddColumn extends Vue { this.showInput = false let instance = this.instance - this.pubTL.push(instance) + this.pubTL.push({ name: instance, statuses: [] }) this.timeline() } public timeline() { - this.pubTL.forEach(function (value) { - ipcRenderer.send('no-auth-timeline', value); + this.pubTL.forEach(function (tl) { + ipcRenderer.on(`timeline-${tl.name}-no-auth`, (_: Event, statuses: Status[]) => { + tl.statuses = statuses + }) + ipcRenderer.send('no-auth-timeline', tl.name) }); } } diff --git a/src/main/Client.ts b/src/main/Client.ts index 066f90a7..a240dac3 100644 --- a/src/main/Client.ts +++ b/src/main/Client.ts @@ -1,7 +1,7 @@ import Mastodon from 'megalodon' -type Protocol = 'http' | 'ws' +type Protocol = 'http' | 'websocket' export default class Clients { // Authorized Accounts. keyには`@username@domain`を設定します diff --git a/src/main/Streaming.ts b/src/main/Streaming.ts index 4d3202fa..f6d21f84 100644 --- a/src/main/Streaming.ts +++ b/src/main/Streaming.ts @@ -29,7 +29,7 @@ export default class Streaming { switch (type) { case 'no-auth': - client = Client.getNoAuthClient(name) + client = Client.getNoAuthClient(name, 'websocket') stream = 'public:local' break default: