refs #983 Use static method to call instance API
This commit is contained in:
parent
1c836dfb95
commit
8ce514a4fb
|
@ -3,8 +3,7 @@ import log from 'electron-log'
|
|||
import { LocalAccount } from '~/src/types/localAccount'
|
||||
|
||||
const StreamingURL = async (account: LocalAccount): Promise<string> => {
|
||||
const client = new Mastodon(account.accessToken!, account.baseURL + '/api/v1')
|
||||
const res = await client.get<Instance>('/instance')
|
||||
const res = await Mastodon.get<Instance>('/api/v1/instance', {}, account.baseURL)
|
||||
return res.data.urls.streaming_api
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue