separated parsing from api.getUser(), logging folreqs
This commit is contained in:
parent
891aa09467
commit
6c11c67eb4
4 changed files with 10 additions and 14 deletions
|
@ -74,7 +74,7 @@ export class Client {
|
|||
return await api.revokeToken();
|
||||
}
|
||||
|
||||
async getUser() {
|
||||
async getClientUser() {
|
||||
// already known
|
||||
if (this.user) return this.user;
|
||||
|
||||
|
@ -90,6 +90,7 @@ export class Client {
|
|||
}
|
||||
const user = await api.parseUser(data);
|
||||
console.log(`Logged in as @${user.username}@${user.host}`);
|
||||
console.log(`You have ${data.source.follow_request_count} follow request${data.source.follow_request_count === 1 ? '' : 's'}!`);
|
||||
return user;
|
||||
}
|
||||
|
||||
|
@ -161,6 +162,10 @@ export class Client {
|
|||
return emoji;
|
||||
}
|
||||
|
||||
async getUser(user_id) {
|
||||
return await api.getUser(user_id);
|
||||
}
|
||||
|
||||
save() {
|
||||
if (typeof localStorage === typeof undefined) return;
|
||||
localStorage.setItem(save_name, JSON.stringify({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue