mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
remove getUserId operator (#13091)
This commit is contained in:
@@ -8,7 +8,6 @@ import { ApiService } from "../../abstractions/api.service";
|
|||||||
import { AccountService } from "../../auth/abstractions/account.service";
|
import { AccountService } from "../../auth/abstractions/account.service";
|
||||||
import { AuthService } from "../../auth/abstractions/auth.service";
|
import { AuthService } from "../../auth/abstractions/auth.service";
|
||||||
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
|
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
|
||||||
import { getUserId } from "../../auth/services/account.service";
|
|
||||||
import {
|
import {
|
||||||
SyncCipherNotification,
|
SyncCipherNotification,
|
||||||
SyncFolderNotification,
|
SyncFolderNotification,
|
||||||
@@ -59,7 +58,7 @@ export abstract class CoreSyncService implements SyncService {
|
|||||||
abstract fullSync(forceSync: boolean, allowThrowOnError?: boolean): Promise<boolean>;
|
abstract fullSync(forceSync: boolean, allowThrowOnError?: boolean): Promise<boolean>;
|
||||||
|
|
||||||
async getLastSync(): Promise<Date> {
|
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) {
|
if (userId == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// FIXME: Update this file to be type safe and remove this and next line
|
// FIXME: Update this file to be type safe and remove this and next line
|
||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { firstValueFrom } from "rxjs";
|
import { firstValueFrom, map } from "rxjs";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CollectionService,
|
CollectionService,
|
||||||
@@ -34,7 +34,6 @@ import { InternalMasterPasswordServiceAbstraction } from "../../auth/abstraction
|
|||||||
import { TokenService } from "../../auth/abstractions/token.service";
|
import { TokenService } from "../../auth/abstractions/token.service";
|
||||||
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
|
import { AuthenticationStatus } from "../../auth/enums/authentication-status";
|
||||||
import { ForceSetPasswordReason } from "../../auth/models/domain/force-set-password-reason";
|
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 { DomainSettingsService } from "../../autofill/services/domain-settings.service";
|
||||||
import { BillingAccountProfileStateService } from "../../billing/abstractions";
|
import { BillingAccountProfileStateService } from "../../billing/abstractions";
|
||||||
import { DomainsResponse } from "../../models/response/domains.response";
|
import { DomainsResponse } from "../../models/response/domains.response";
|
||||||
@@ -108,7 +107,7 @@ export class DefaultSyncService extends CoreSyncService {
|
|||||||
|
|
||||||
@sequentialize(() => "fullSync")
|
@sequentialize(() => "fullSync")
|
||||||
override async fullSync(forceSync: boolean, allowThrowOnError = false): Promise<boolean> {
|
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();
|
this.syncStarted();
|
||||||
const authStatus = await firstValueFrom(this.authService.authStatusFor$(userId));
|
const authStatus = await firstValueFrom(this.authService.authStatusFor$(userId));
|
||||||
if (authStatus === AuthenticationStatus.LoggedOut) {
|
if (authStatus === AuthenticationStatus.LoggedOut) {
|
||||||
|
|||||||
Reference in New Issue
Block a user