thedesk/src/main/Timeline.ts

18 lines
512 B
TypeScript
Raw Normal View History

2019-04-24 01:07:20 +09:00
import {
2019-04-24 19:31:06 +09:00
ipcMain,
Event
2019-04-24 01:07:20 +09:00
} from 'electron'
2019-04-24 05:30:16 +09:00
import { Status, Response } from 'megalodon'
2019-04-24 03:58:06 +09:00
import Client from './Client'
2019-04-24 05:30:16 +09:00
import Window from './Window'
2019-04-24 03:58:06 +09:00
2019-04-24 01:07:20 +09:00
export default class Timeline {
public static ready() {
2019-04-24 05:30:16 +09:00
ipcMain.on('no-auth-timeline', async (event: Event, name: string) => {
const client = Client.getNoAuthClient(name)
let res: Response<[Status]> = await client.get<[Status]>('/timelines/public?local=true')
2019-04-24 19:31:06 +09:00
event.returnValue = res.data
})
2019-04-24 01:07:20 +09:00
}
}