mirror of
https://github.com/balzack/databag.git
synced 2025-04-24 10:35:23 +00:00
renaming handle method to username
This commit is contained in:
parent
bed9b22b04
commit
f08e738f9a
@ -33,10 +33,6 @@ export class MockIdentityModule implements Identity {
|
||||
public async setProfileImage(image: string): Promise<void> {
|
||||
}
|
||||
|
||||
public async getHandleStatus(handle: string): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public getProfileImageUrl(): string {
|
||||
return '';
|
||||
}
|
||||
|
@ -61,6 +61,10 @@ export class MockSettingsModule implements Settings {
|
||||
public async forgetSeal(): Promise<void> {
|
||||
}
|
||||
|
||||
public async getUsernameStatus(username: string): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async setLogin(username: string, password: string): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ export interface Ring {
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
getUsernameStatus(username: string): Promise<boolean>;
|
||||
setLogin(username: string, password: string): Promise<void>;
|
||||
enableNotifications(): Promise<void>;
|
||||
disableNotifications(): Promise<void>;
|
||||
@ -57,7 +58,6 @@ export interface Settings {
|
||||
export interface Identity {
|
||||
setProfileData(name: string, location: string, description: string): Promise<void>;
|
||||
setProfileImage(image: string): Promise<void>;
|
||||
getHandleStatus(handle: string): Promise<boolean>;
|
||||
|
||||
getProfileImageUrl(): string;
|
||||
|
||||
|
@ -7,7 +7,6 @@ import { getProfile } from './net/getProfile';
|
||||
import { getProfileImageUrl } from './net/getProfileImageUrl';
|
||||
import { setProfileData } from './net/setProfileData';
|
||||
import { setProfileImage } from './net/setProfileImage';
|
||||
import { getUsername } from './net/getUsername';
|
||||
import { ProfileEntity, defaultProfileEntity } from './entities';
|
||||
|
||||
const CLOSE_POLL_MS = 100;
|
||||
@ -119,11 +118,6 @@ export class IdentityModule implements Identity {
|
||||
await setProfileImage(node, secure, token, image);
|
||||
}
|
||||
|
||||
public async getHandleStatus(handle: string): Promise<boolean> {
|
||||
const { node, secure, token } = this;
|
||||
return await getUsername(handle, token, node, secure);
|
||||
}
|
||||
|
||||
public getProfileImageUrl(): string {
|
||||
const { node, secure, token, revision } = this;
|
||||
return getProfileImageUrl(node, secure, token, revision);
|
||||
|
@ -14,6 +14,7 @@ import { setAccountNotifications } from './net/setAccountNotifications';
|
||||
import { setAccountSearchable } from './net/setAccountSearchable';
|
||||
import { setAccountSeal } from './net/setAccountSeal';
|
||||
import { clearAccountSeal } from './net/clearAccountSeal';
|
||||
import { getUsername } from './net/getUsername';
|
||||
|
||||
const CLOSE_POLL_MS = 100;
|
||||
const RETRY_POLL_MS = 2000;
|
||||
@ -213,6 +214,11 @@ export class SettingsModule implements Settings {
|
||||
this.emitter.emit('config', this.getStatus());
|
||||
}
|
||||
|
||||
public async getUsernameStatus(username: string): Promise<boolean> {
|
||||
const { node, secure, token } = this;
|
||||
return await getUsername(username, token, node, secure);
|
||||
}
|
||||
|
||||
public async setLogin(username: string, password: string): Promise<void> {
|
||||
const { node, secure, token } = this;
|
||||
await setAccountLogin(node, secure, token, username, password);
|
||||
|
Loading…
x
Reference in New Issue
Block a user