mirror of
https://github.com/bitwarden/browser
synced 2026-02-27 01:53:23 +00:00
Remove test code
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, inject } from "@angular/core";
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { NavigationEnd, Router, RouterOutlet } from "@angular/router";
|
||||
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap, map } from "rxjs";
|
||||
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap } from "rxjs";
|
||||
|
||||
import { DeviceTrustToastService } from "@bitwarden/angular/auth/services/device-trust-toast.service.abstraction";
|
||||
import { LogoutReason } from "@bitwarden/auth/common";
|
||||
@@ -13,7 +13,6 @@ import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authenticatio
|
||||
import { AnimationControlService } from "@bitwarden/common/platform/abstractions/animation-control.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { SdkService } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { MessageListener } from "@bitwarden/common/platform/messaging";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
@@ -75,27 +74,10 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
private biometricsService: BiometricsService,
|
||||
private deviceTrustToastService: DeviceTrustToastService,
|
||||
private popupSizeService: PopupSizeService,
|
||||
private sdkService: SdkService,
|
||||
) {
|
||||
this.deviceTrustToastService.setupListeners$.pipe(takeUntilDestroyed()).subscribe();
|
||||
}
|
||||
|
||||
/* eslint-disable no-console */
|
||||
async testSdkState() {
|
||||
const userId = (await firstValueFrom(this.accountService.activeAccount$)).id;
|
||||
await firstValueFrom(
|
||||
this.sdkService.userClient$(userId).pipe(
|
||||
map(async (clientRc) => {
|
||||
using clientRef = clientRc.take();
|
||||
const client = clientRef.value;
|
||||
|
||||
const ciphers = await client.vault().print_the_ciphers();
|
||||
console.log("Ciphers2: ", ciphers);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
initPopupClosedListener();
|
||||
|
||||
@@ -218,10 +200,6 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
.subscribe((state) => {
|
||||
this.routerAnimations = state;
|
||||
});
|
||||
|
||||
this.testSdkState().catch((e) => {
|
||||
console.error("Error in testSdkState()", e);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
||||
@@ -232,8 +232,8 @@ export class DefaultSdkService implements SdkService {
|
||||
),
|
||||
});
|
||||
|
||||
// This is optional to avoid having to mock it on the server
|
||||
if (this.stateProvider) {
|
||||
// Initialize the cipher store
|
||||
client
|
||||
.platform()
|
||||
.repository()
|
||||
@@ -245,15 +245,6 @@ export class DefaultSdkService implements SdkService {
|
||||
new CipherMapper(),
|
||||
),
|
||||
);
|
||||
|
||||
try {
|
||||
const result = await client.vault().print_the_ciphers();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Ciphers: " + result);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error printing ciphers: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user