From 65d675041a48b236e8e9fe227d6649f275271ba0 Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Thu, 5 May 2022 16:08:59 -0400 Subject: [PATCH] WIP for the new "log in" page --- src/app/log-in/log-in.component.html | 28 ++++++++++++++++--- src/app/log-in/log-in.component.ts | 28 +++++++------------ .../test-lbry-log-in.component.ts | 4 ++- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/app/log-in/log-in.component.html b/src/app/log-in/log-in.component.html index 88629a7..9f87b08 100644 --- a/src/app/log-in/log-in.component.html +++ b/src/app/log-in/log-in.component.html @@ -1,15 +1,23 @@ + +
- Log in to {{ globalVars.hostname }} + Choose an account to share with {{ globalVars.hostname }}
-
+ + +
    Select an account
    -
  • +
  • {{ item.key }}…
    @@ -20,11 +28,18 @@
+
+ - Log in with DeSo seed + + Wallet Sync Log In
@@ -32,6 +47,11 @@ Logging in grants {{ globalVars.hostname }} access to:
+
  • diff --git a/src/app/log-in/log-in.component.ts b/src/app/log-in/log-in.component.ts index 4773539..b834ee0 100644 --- a/src/app/log-in/log-in.component.ts +++ b/src/app/log-in/log-in.component.ts @@ -2,7 +2,9 @@ import {Component, OnInit} from '@angular/core'; import {AccountService} from '../account.service'; import {IdentityService} from '../identity.service'; import {GlobalVarsService} from '../global-vars.service'; -import {BackendAPIService} from '../backend-api.service'; + +// This is logging into the app, not the wallet sync +// TODO rename this component to app-log-in @Component({ selector: 'app-log-in', @@ -10,34 +12,24 @@ import {BackendAPIService} from '../backend-api.service'; styleUrls: ['./log-in.component.scss'] }) export class LogInComponent implements OnInit { - allUsernames: {[key: string]: string} = {}; - hasUsers = false; + allAccountNames: {[key: string]: string} = {}; constructor( private accountService: AccountService, private identityService: IdentityService, public globalVars: GlobalVarsService, - private backendApi: BackendAPIService, ) { } ngOnInit(): void { - // Load profile pictures and usernames - const publicKeys = this.accountService.getPublicKeys(); - this.hasUsers = publicKeys.length > 0; - this.backendApi.GetUsernames(publicKeys) - .subscribe(usernames => { - // TODO - LBRY - probably gut this whole page, don't need to list - // users. we're not going to have a login history like this. but go - // over the html to make sure. - this.allUsernames = usernames; - }); + // TODO - Will be channel claim IDs + this.allAccountNames = this.accountService.getAccountNames(); } - selectAccount(publicKey: string): void { - this.accountService.setAccessLevel(publicKey, this.globalVars.hostname, this.globalVars.accessLevelRequest); + selectAccount(accountName: string): void { + this.accountService.setAccessLevel(accountName, this.globalVars.hostname, this.globalVars.accessLevelRequest); this.identityService.login({ - users: this.accountService.getEncryptedUsers(), - publicKeyAdded: publicKey, + accounts: this.accountService.getPublicAccounts(), + accountNameAdded: accountName, signedUp: false }); } diff --git a/src/app/test-lbry-log-in/test-lbry-log-in.component.ts b/src/app/test-lbry-log-in/test-lbry-log-in.component.ts index d09efa0..1066d73 100644 --- a/src/app/test-lbry-log-in/test-lbry-log-in.component.ts +++ b/src/app/test-lbry-log-in/test-lbry-log-in.component.ts @@ -102,7 +102,9 @@ export class TestLbryLogInComponent implements OnInit { const wallet = JSON.parse(walletStr) this.cryptoService.putWallet(this.globalVars.hostname, wallet); - this.router.navigate(['/', RouteNames.LOG_IN], {queryParamsHandling: 'merge'}); + throw "fix me" + // For now, we'll just pick the first channel in the wallet and log right in + // this.router.navigate(['/', RouteNames.LOG_IN], {queryParamsHandling: 'merge'}); } }