20 lines
624 B
TypeScript
Raw Normal View History

2019-04-24 01:07:20 +09:00
import {
ipcMain
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 05:30:16 +09:00
if (Window.windowMap.has('main')) {
Window.windowMap.get('main')!.webContents.send(`timeline-${name}-no-auth`, res.data)
}
})
2019-04-24 01:07:20 +09:00
}
}