Remove load-seed component
We won't be "loading a seed". We'll be doing a wallet service login in the long run, pasting a wallet in the interim.
This commit is contained in:
parent
eecf21aec4
commit
ee4db066a0
6 changed files with 0 additions and 120 deletions
|
@ -9,7 +9,6 @@ import {LogoutComponent} from './logout/logout.component';
|
|||
import {SignUpComponent} from './sign-up/sign-up.component';
|
||||
import {LogInComponent} from './log-in/log-in.component';
|
||||
import {ApproveComponent} from './approve/approve.component';
|
||||
import {LoadSeedComponent} from './load-seed/load-seed.component';
|
||||
|
||||
export class RouteNames {
|
||||
public static TEST_SIGN = 'test-sign';
|
||||
|
@ -19,7 +18,6 @@ export class RouteNames {
|
|||
public static LOGOUT = 'logout';
|
||||
public static SIGN_UP = 'sign-up';
|
||||
public static LOG_IN = 'log-in';
|
||||
public static LOAD_SEED = 'load-seed';
|
||||
public static APPROVE = 'approve';
|
||||
}
|
||||
|
||||
|
@ -32,7 +30,6 @@ const routes: Routes = [
|
|||
{ path: RouteNames.LOGOUT, component: LogoutComponent, pathMatch: 'full' },
|
||||
{ path: RouteNames.SIGN_UP, component: SignUpComponent, pathMatch: 'full' },
|
||||
{ path: RouteNames.LOG_IN, component: LogInComponent, pathMatch: 'full' },
|
||||
{ path: RouteNames.LOAD_SEED, component: LoadSeedComponent, pathMatch: 'full' },
|
||||
{ path: RouteNames.APPROVE, component: ApproveComponent, pathMatch: 'full' },
|
||||
];
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import {EntropyService} from './entropy.service';
|
|||
import { LogInComponent } from './log-in/log-in.component';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import { ApproveComponent } from './approve/approve.component';
|
||||
import { LoadSeedComponent } from './load-seed/load-seed.component';
|
||||
import { ErrorCallbackComponent } from './error-callback/error-callback.component';
|
||||
import { NgxIntlTelInputModule } from 'ngx-intl-tel-input';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
@ -36,7 +35,6 @@ import { TestLbryLogInComponent } from './test-lbry-log-in/test-lbry-log-in.comp
|
|||
SignUpComponent,
|
||||
LogInComponent,
|
||||
ApproveComponent,
|
||||
LoadSeedComponent,
|
||||
ErrorCallbackComponent,
|
||||
TestSignComponent,
|
||||
TestSignTransactionComponent,
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<app-banner></app-banner>
|
||||
|
||||
<div class="page-container" *ngIf="globalVars.inTab || globalVars.webview || globalVars.callback">
|
||||
<div class="title-text">
|
||||
Log in to {{ globalVars.hostname }}
|
||||
</div>
|
||||
|
||||
<p class="main-text mb-20px">
|
||||
Enter your DeSo seed phrase to load your account
|
||||
</p>
|
||||
|
||||
<div *ngIf="loadSeedError" class="alert alert-danger mt-15px">
|
||||
{{ loadSeedError }}
|
||||
</div>
|
||||
|
||||
<div class="text-input-container">
|
||||
<textarea [(ngModel)]="mnemonic"
|
||||
class="text-input"
|
||||
rows="4"
|
||||
placeholder="Enter your DeSo seed phrase"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="main-text mb-20px">
|
||||
If you have a passphrase, enter it below.
|
||||
</div>
|
||||
<div class="text-input-container">
|
||||
<textarea [(ngModel)]="extraText"
|
||||
class="text-input"
|
||||
rows="4"
|
||||
placeholder="Enter your passphrase"></textarea>
|
||||
</div>
|
||||
|
||||
<button (click)="clickLoadAccount()"
|
||||
class="button button-primary button-large">
|
||||
Load Account
|
||||
</button>
|
||||
</div>
|
|
@ -1,25 +0,0 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoadSeedComponent } from './load-seed.component';
|
||||
|
||||
describe('LoadSeedComponent', () => {
|
||||
let component: LoadSeedComponent;
|
||||
let fixture: ComponentFixture<LoadSeedComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ LoadSeedComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LoadSeedComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -1,53 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import {AccountService} from '../account.service';
|
||||
import {CryptoService} from '../crypto.service';
|
||||
import {EntropyService} from '../entropy.service';
|
||||
import {GlobalVarsService} from '../global-vars.service';
|
||||
import {Router} from '@angular/router';
|
||||
import {RouteNames} from '../app-routing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'app-load-seed',
|
||||
templateUrl: './load-seed.component.html',
|
||||
styleUrls: ['./load-seed.component.scss']
|
||||
})
|
||||
export class LoadSeedComponent implements OnInit {
|
||||
// Loading an account
|
||||
loadSeedError = '';
|
||||
mnemonic = '';
|
||||
extraText = '';
|
||||
|
||||
constructor(
|
||||
private accountService: AccountService,
|
||||
private cryptoService: CryptoService,
|
||||
private entropyService: EntropyService,
|
||||
public globalVars: GlobalVarsService,
|
||||
private router: Router,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
clickLoadAccount(): void {
|
||||
// Store mnemonic and extraText locally because we clear them below and otherwise
|
||||
// they don't get saved in local storage reliably
|
||||
const mnemonic = this.mnemonic;
|
||||
const extraText = this.extraText;
|
||||
const network = this.globalVars.network;
|
||||
|
||||
if (!this.entropyService.isValidMnemonic(mnemonic)) {
|
||||
this.loadSeedError = 'Invalid mnemonic';
|
||||
return;
|
||||
}
|
||||
|
||||
const keychain = this.cryptoService.mnemonicToKeychain(mnemonic, extraText);
|
||||
|
||||
this.accountService.addUser(keychain, mnemonic, extraText, network);
|
||||
|
||||
// Clear the form
|
||||
this.mnemonic = '';
|
||||
this.extraText = '';
|
||||
|
||||
this.router.navigate(['/', RouteNames.LOG_IN], {queryParamsHandling: 'merge'});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue