1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PS-1854] Split folder service back/foreground (#4209)

* Split folder service back/foreground

Also splits for folderApiService, since that depends on folderService.

TODO: this split will need to be done for any dependents of a split
service.

* Prefer popup-specific services VaultFilterService

* Prefer popup-specific services i18n

* Prefer popup-specific services configService

* StateService is required for browserSync

* Add Policy Api Service

* Remove unused orgService from PolicyApiService

* Fixup missed dependency

* Attach cryptography services in popup context

* Improve session syncer initialization
This commit is contained in:
Matt Gibson
2023-01-30 14:04:22 -05:00
committed by GitHub
parent b7d38f0f72
commit b208866109
9 changed files with 142 additions and 36 deletions

View File

@@ -1,3 +1,5 @@
import { Jsonify } from "type-fest";
import {
ServerConfigData,
ThirdPartyServerConfigData,
@@ -37,4 +39,12 @@ export class ServerConfig {
expiresSoon(): boolean {
return this.getAgeInMilliseconds() >= eighteenHoursInMilliseconds;
}
static fromJSON(obj: Jsonify<ServerConfig>): ServerConfig {
if (obj == null) {
return null;
}
return new ServerConfig(obj);
}
}

View File

@@ -7,7 +7,7 @@ import { StateService } from "../../abstractions/state.service";
import { ServerConfigData } from "../../models/data/server-config.data";
export class ConfigService implements ConfigServiceAbstraction {
private _serverConfig = new BehaviorSubject<ServerConfig | null>(null);
protected _serverConfig = new BehaviorSubject<ServerConfig | null>(null);
serverConfig$ = this._serverConfig.asObservable();
constructor(

View File

@@ -3,7 +3,7 @@ import { Observable, ReplaySubject } from "rxjs";
import { I18nService as I18nServiceAbstraction } from "../abstractions/i18n.service";
export class I18nService implements I18nServiceAbstraction {
private _locale = new ReplaySubject<string>(1);
protected _locale = new ReplaySubject<string>(1);
locale$: Observable<string> = this._locale.asObservable();
// First locale is the default (English)
supportedTranslationLocales: string[] = ["en"];