Fix types
This commit is contained in:
parent
bef66376bc
commit
107e885aeb
|
@ -40,6 +40,7 @@ const account: Entity.Account = {
|
||||||
acct: 'h3poteto@pleroma.io',
|
acct: 'h3poteto@pleroma.io',
|
||||||
display_name: 'h3poteto',
|
display_name: 'h3poteto',
|
||||||
locked: false,
|
locked: false,
|
||||||
|
group: false,
|
||||||
created_at: '2019-03-26T21:30:32',
|
created_at: '2019-03-26T21:30:32',
|
||||||
followers_count: 10,
|
followers_count: 10,
|
||||||
following_count: 10,
|
following_count: 10,
|
||||||
|
|
|
@ -70,6 +70,7 @@ const account: Entity.Account = {
|
||||||
acct: 'h3poteto@pleroma.io',
|
acct: 'h3poteto@pleroma.io',
|
||||||
display_name: 'h3poteto',
|
display_name: 'h3poteto',
|
||||||
locked: false,
|
locked: false,
|
||||||
|
group: false,
|
||||||
created_at: '2019-03-26T21:30:32',
|
created_at: '2019-03-26T21:30:32',
|
||||||
followers_count: 10,
|
followers_count: 10,
|
||||||
following_count: 10,
|
following_count: 10,
|
||||||
|
|
|
@ -441,6 +441,9 @@ app.on('activate', () => {
|
||||||
ipcMain.handle('add-server', async (_: IpcMainInvokeEvent, domain: string) => {
|
ipcMain.handle('add-server', async (_: IpcMainInvokeEvent, domain: string) => {
|
||||||
const proxy = await proxyConfiguration.forMastodon()
|
const proxy = await proxyConfiguration.forMastodon()
|
||||||
const sns = await detector(`https://${domain}`, proxy)
|
const sns = await detector(`https://${domain}`, proxy)
|
||||||
|
if (sns === 'friendica') {
|
||||||
|
return new Promise((_resolve, reject) => reject('friendica is not supported yet'))
|
||||||
|
}
|
||||||
const server = await insertServer(db, `https://${domain}`, domain, sns, null)
|
const server = await insertServer(db, `https://${domain}`, domain, sns, null)
|
||||||
return server
|
return server
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,7 +14,10 @@ const StreamingURL = async (
|
||||||
}
|
}
|
||||||
const client = generator(sns, server.baseURL, account.accessToken, 'Whalebird', proxy)
|
const client = generator(sns, server.baseURL, account.accessToken, 'Whalebird', proxy)
|
||||||
const res = await client.getInstance()
|
const res = await client.getInstance()
|
||||||
return res.data.urls.streaming_api
|
if (res.data.urls) {
|
||||||
|
return res.data.urls.streaming_api
|
||||||
|
}
|
||||||
|
return new Promise((_resolve, reject) => reject('streaming URL does not exist'))
|
||||||
}
|
}
|
||||||
|
|
||||||
export { StreamingURL }
|
export { StreamingURL }
|
||||||
|
|
Loading…
Reference in New Issue