1
0
Fork 0
mirror of https://github.com/cheeaun/phanpy.git synced 2025-05-03 13:43:10 +03:00

Try non-blocking init

This commit is contained in:
Lim Chee Aun 2024-09-16 19:11:25 +08:00
parent 142e211196
commit 8f6b4c6420
2 changed files with 21 additions and 4 deletions
src/utils

View file

@ -57,6 +57,11 @@ export function initClient({ instance, accessToken }) {
return client;
}
export function hasInstance(instance) {
const instances = store.local.getJSON('instances') || {};
return !!instances[instance];
}
// Get the instance information
// The config is needed for composing
export async function initInstance(client, instance) {
@ -132,6 +137,10 @@ export async function initAccount(client, instance, accessToken, vapidKey) {
});
}
export function hasPreferences() {
return !!store.account.get('preferences');
}
// Get preferences
export async function initPreferences(client) {
try {