Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
--global committed Jan 17, 2025
1 parent 7f51254 commit 67c9019
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import { VaultOnboardingTasks } from "../vault-onboarding.service";

export abstract class VaultOnboardingService {
abstract setVaultOnboardingTasks(newState: VaultOnboardingTasks): Promise<void>;
abstract getVaultOnboardingState$(userId: UserId): Observable<VaultOnboardingTasks>;
abstract vaultOnboardingState$(userId: UserId): Observable<VaultOnboardingTasks>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ const VAULT_ONBOARDING_KEY = new UserKeyDefinition<VaultOnboardingTasks>(
@Injectable()
export class VaultOnboardingService implements VaultOnboardingServiceAbstraction {
private vaultOnboardingState: SingleUserState<VaultOnboardingTasks>;
vaultOnboardingState$: Observable<VaultOnboardingTasks>;

constructor(private stateProvider: StateProvider) {}

getVaultOnboardingState$(userId: UserId): Observable<VaultOnboardingTasks> {
vaultOnboardingState$(userId: UserId): Observable<VaultOnboardingTasks> {
this.vaultOnboardingState = this.stateProvider.getUser(userId, VAULT_ONBOARDING_KEY);
this.vaultOnboardingState$ = this.vaultOnboardingState.state$;
return this.vaultOnboardingState$;
return this.vaultOnboardingState.state$;
}

async setVaultOnboardingTasks(newState: VaultOnboardingTasks): Promise<void> {
await this.vaultOnboardingState.update(() => {
return { ...newState };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class VaultOnboardingComponent implements OnInit, OnChanges, OnDestroy {

async ngOnInit() {
this.onboardingTasks$ = this.activeUserId$.pipe(
switchMap((userId) => this.vaultOnboardingService.getVaultOnboardingState$(userId)),
switchMap((userId) => this.vaultOnboardingService.vaultOnboardingState$(userId)),
);

await this.setOnboardingTasks();
Expand Down

0 comments on commit 67c9019

Please sign in to comment.