Commit cb10510a authored by Emily Jensen's avatar Emily Jensen

Backup code updating in state

parent 3ed4e127
Pipeline #36421186 failed with stage
in 3 minutes and 18 seconds
......@@ -368,6 +368,11 @@ export const manageBackupCodeHasFinished = createSelector(
fromManageBackupCode.getHasFinished
);
export const manageBackupCodeNewBackupCode = createSelector(
selectManageBackupCodeState,
fromManageBackupCode.getNewBackupCode
);
export const manageBackupCodeErrorMessage = createSelector(
selectManageBackupCodeState,
fromManageBackupCode.getErrorMessage
......
import { Component, ChangeDetectionStrategy } from "@angular/core";
import * as fromAccount from "../account.reducer";
import { Store } from "@ngrx/store";
import { SubmitForm } from "./manage-backup-code.actions";
import { SubmitFormSuccess, SubmitForm } from "./manage-backup-code.actions";
@Component({
template: `
......@@ -10,7 +10,7 @@ import { SubmitForm } from "./manage-backup-code.actions";
[hasStarted]="hasStarted$ | async"
[hasFinished]="hasFinished$ | async"
[errorMessage]="errorMessage$ | async"
[backupCode]="backupCode"
[backupCode]="backupCode$ | async"
(newBackupCode)="newBackupCode()"
></app-manage-backup-code>
`,
......@@ -21,11 +21,12 @@ export class ManageBackupCodeContainer {
hasStarted$ = this.store.select(fromAccount.manageBackupCode);
hasFinished$ = this.store.select(fromAccount.manageBackupCode);
errorMessage$ = this.store.select(fromAccount.manageBackupCodeErrorMessage);
backupCode = null;
// backupCode$ = this.store.select(fromAccount.manageBackupCodeNewBackupCode);
constructor(private store: Store<fromAccount.IAuthState>) {}
newBackupCode() {
this.store.dispatch(new SubmitForm());
this.store.dispatch(new SubmitFormSuccess("This is not your backup code"));
}
}
......@@ -85,3 +85,4 @@ export const getForm = (state: IState) => state.form;
export const getErrorMessage = (state: IState) => state.errorMessage;
export const getHasStarted = (state: IState) => state.hasStarted;
export const getHasFinished = (state: IState) => state.hasFinished;
export const getNewBackupCode = (state: IState) => state.newBackupCode;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment