mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-05-02 21:23:13 +03:00
Respect your preferences
This commit is contained in:
parent
2cd235a069
commit
91aeed5fe6
3 changed files with 36 additions and 4 deletions
src/utils
|
@ -100,6 +100,18 @@ export async function initAccount(client, instance, accessToken) {
|
|||
});
|
||||
}
|
||||
|
||||
// Get preferences
|
||||
export async function initPreferences(client) {
|
||||
try {
|
||||
const masto = client;
|
||||
const preferences = await masto.v1.preferences.fetch();
|
||||
store.account.set('preferences', preferences);
|
||||
} catch (e) {
|
||||
// silently fail
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the masto instance
|
||||
// If accountID is provided, get the masto instance for that account
|
||||
export function api({ instance, accessToken, accountID, account } = {}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue