From f08e738f9a623231ef960ac77597f317c8662848 Mon Sep 17 00:00:00 2001 From: balzack Date: Wed, 28 Aug 2024 18:51:22 -0700 Subject: [PATCH] renaming handle method to username --- app/sdk/__mocks__/identity.ts | 4 ---- app/sdk/__mocks__/settings.ts | 4 ++++ app/sdk/src/api.ts | 2 +- app/sdk/src/identity.ts | 6 ------ app/sdk/src/settings.ts | 6 ++++++ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/sdk/__mocks__/identity.ts b/app/sdk/__mocks__/identity.ts index ebdd7f1d..b48e53ce 100644 --- a/app/sdk/__mocks__/identity.ts +++ b/app/sdk/__mocks__/identity.ts @@ -33,10 +33,6 @@ export class MockIdentityModule implements Identity { public async setProfileImage(image: string): Promise { } - public async getHandleStatus(handle: string): Promise { - return false; - } - public getProfileImageUrl(): string { return ''; } diff --git a/app/sdk/__mocks__/settings.ts b/app/sdk/__mocks__/settings.ts index 9c251bf2..2195ed07 100644 --- a/app/sdk/__mocks__/settings.ts +++ b/app/sdk/__mocks__/settings.ts @@ -61,6 +61,10 @@ export class MockSettingsModule implements Settings { public async forgetSeal(): Promise { } + public async getUsernameStatus(username: string): Promise { + return false; + } + public async setLogin(username: string, password: string): Promise { } } diff --git a/app/sdk/src/api.ts b/app/sdk/src/api.ts index a8dfb904..325ca973 100644 --- a/app/sdk/src/api.ts +++ b/app/sdk/src/api.ts @@ -37,6 +37,7 @@ export interface Ring { } export interface Settings { + getUsernameStatus(username: string): Promise; setLogin(username: string, password: string): Promise; enableNotifications(): Promise; disableNotifications(): Promise; @@ -57,7 +58,6 @@ export interface Settings { export interface Identity { setProfileData(name: string, location: string, description: string): Promise; setProfileImage(image: string): Promise; - getHandleStatus(handle: string): Promise; getProfileImageUrl(): string; diff --git a/app/sdk/src/identity.ts b/app/sdk/src/identity.ts index 2ecda929..1f88fcd9 100644 --- a/app/sdk/src/identity.ts +++ b/app/sdk/src/identity.ts @@ -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 { - 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); diff --git a/app/sdk/src/settings.ts b/app/sdk/src/settings.ts index 6c59d842..37ed69ca 100644 --- a/app/sdk/src/settings.ts +++ b/app/sdk/src/settings.ts @@ -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 { + const { node, secure, token } = this; + return await getUsername(username, token, node, secure); + } + public async setLogin(username: string, password: string): Promise { const { node, secure, token } = this; await setAccountLogin(node, secure, token, username, password);