Move Timeline.ready to Application.onReady
Disabled add column button if not input
This commit is contained in:
@@ -9,13 +9,14 @@ import {
|
||||
} from 'vue-cli-plugin-electron-builder/lib'
|
||||
|
||||
import Window from './Window'
|
||||
import Timeline from './Timeline'
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||
|
||||
export default class Application {
|
||||
private static _instance: Application
|
||||
|
||||
public static get shared() {
|
||||
public static get shared(): Application {
|
||||
// Do you need arguments? Make it a regular static method instead.
|
||||
return this._instance || (this._instance = new this())
|
||||
}
|
||||
@@ -46,6 +47,9 @@ export default class Application {
|
||||
}
|
||||
}
|
||||
if (!process.env.WEBPACK_DEV_SERVER_URL) createProtocol('app')
|
||||
|
||||
Timeline.ready()
|
||||
|
||||
Window.Main()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import {
|
||||
ipcMain
|
||||
ipcMain
|
||||
} from 'electron'
|
||||
import Mastodon, { Status, Response } from 'megalodon'
|
||||
//この書き方がいいのかは知りません。(cutls|background.ts)
|
||||
|
||||
export default class Timeline {
|
||||
static timelineReady() {
|
||||
ipcMain.on('no-auth-streaming', (event: Event, instance :String) => {
|
||||
const client = new Mastodon(
|
||||
"",
|
||||
"https://"+instance + '/api/v1'
|
||||
)
|
||||
|
||||
client.get<[Status]>('/timelines/public?local=true')
|
||||
.then((resp: Response<[Status]>) => {
|
||||
console.log(resp.data)
|
||||
})
|
||||
})
|
||||
public static ready() {
|
||||
ipcMain.on('no-auth-streaming', (event: Event, instance: string) => {
|
||||
const client = new Mastodon(
|
||||
'',
|
||||
'https://' + instance + '/api/v1'
|
||||
)
|
||||
|
||||
client.get<[Status]>('/timelines/public?local=true')
|
||||
.then((resp: Response<[Status]>) => {
|
||||
console.log(resp.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user