Skip to content

Commit

Permalink
remove getUserId operator (#13091)
Browse files Browse the repository at this point in the history
  • Loading branch information
BTreston authored Jan 27, 2025
1 parent 146939b commit da422fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions libs/common/src/platform/sync/core-sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ApiService } from "../../abstractions/api.service";
import { AccountService } from "../../auth/abstractions/account.service";
import { AuthService } from "../../auth/abstractions/auth.service";
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
import { getUserId } from "../../auth/services/account.service";
import {
SyncCipherNotification,
SyncFolderNotification,
Expand Down Expand Up @@ -59,7 +58,7 @@ export abstract class CoreSyncService implements SyncService {
abstract fullSync(forceSync: boolean, allowThrowOnError?: boolean): Promise<boolean>;

async getLastSync(): Promise<Date> {
const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(map((a) => a?.id)));
if (userId == null) {
return null;
}
Expand Down
5 changes: 2 additions & 3 deletions libs/common/src/platform/sync/default-sync.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { firstValueFrom } from "rxjs";
import { firstValueFrom, map } from "rxjs";

import {
CollectionService,
Expand Down Expand Up @@ -34,7 +34,6 @@ import { InternalMasterPasswordServiceAbstraction } from "../../auth/abstraction
import { TokenService } from "../../auth/abstractions/token.service";
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
import { ForceSetPasswordReason } from "../../auth/models/domain/force-set-password-reason";
import { getUserId } from "../../auth/services/account.service";
import { DomainSettingsService } from "../../autofill/services/domain-settings.service";
import { BillingAccountProfileStateService } from "../../billing/abstractions";
import { DomainsResponse } from "../../models/response/domains.response";
Expand Down Expand Up @@ -108,7 +107,7 @@ export class DefaultSyncService extends CoreSyncService {

@sequentialize(() => "fullSync")
override async fullSync(forceSync: boolean, allowThrowOnError = false): Promise<boolean> {
const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(map((a) => a?.id)));
this.syncStarted();
const authStatus = await firstValueFrom(this.authService.authStatusFor$(userId));
if (authStatus === AuthenticationStatus.LoggedOut) {
Expand Down

0 comments on commit da422fd

Please sign in to comment.