Fix types

This commit is contained in:
AkiraFukushima 2023-04-30 00:21:01 +09:00
parent bef66376bc
commit 107e885aeb
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
4 changed files with 9 additions and 1 deletions

View File

@ -40,6 +40,7 @@ const account: Entity.Account = {
acct: 'h3poteto@pleroma.io',
display_name: 'h3poteto',
locked: false,
group: false,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,

View File

@ -70,6 +70,7 @@ const account: Entity.Account = {
acct: 'h3poteto@pleroma.io',
display_name: 'h3poteto',
locked: false,
group: false,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,

View File

@ -441,6 +441,9 @@ app.on('activate', () => {
ipcMain.handle('add-server', async (_: IpcMainInvokeEvent, domain: string) => {
const proxy = await proxyConfiguration.forMastodon()
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)
return server
})

View File

@ -14,7 +14,10 @@ const StreamingURL = async (
}
const client = generator(sns, server.baseURL, account.accessToken, 'Whalebird', proxy)
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 }