mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
[PM-7766] Add clientType to MigrationHelper (#8945)
* Add `clientType` to MigrationHelper * PM-7766 - Fix migration builder tests to take new clientType into account. Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com> * PM-7766 - Add client type to migration builder tests. * PM-7766 - Fix migration-helper.spec tests. * PM-7766 - Fix migrator.spec.ts --------- Co-authored-by: Jared Snider <jsnider@bitwarden.com>
This commit is contained in:
@@ -13,10 +13,12 @@ import {
|
||||
OBSERVABLE_DISK_LOCAL_STORAGE,
|
||||
WINDOW,
|
||||
SafeInjectionToken,
|
||||
CLIENT_TYPE,
|
||||
} from "@bitwarden/angular/services/injection-tokens";
|
||||
import { JslibServicesModule } from "@bitwarden/angular/services/jslib-services.module";
|
||||
import { ModalService as ModalServiceAbstraction } from "@bitwarden/angular/services/modal.service";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { ClientType } from "@bitwarden/common/enums";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { FileDownloadService } from "@bitwarden/common/platform/abstractions/file-download/file-download.service";
|
||||
import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
@@ -157,6 +159,10 @@ const safeProviders: SafeProvider[] = [
|
||||
new DefaultThemeStateService(globalStateProvider, ThemeType.Light),
|
||||
deps: [GlobalStateProvider],
|
||||
}),
|
||||
safeProvider({
|
||||
provide: CLIENT_TYPE,
|
||||
useValue: ClientType.Web,
|
||||
}),
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ClientType } from "@bitwarden/common/enums";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
@@ -14,7 +15,7 @@ export class WebMigrationRunner extends MigrationRunner {
|
||||
migrationBuilderService: MigrationBuilderService,
|
||||
private diskLocalStorage: WindowStorageService,
|
||||
) {
|
||||
super(diskStorage, logService, migrationBuilderService);
|
||||
super(diskStorage, logService, migrationBuilderService, ClientType.Web);
|
||||
}
|
||||
|
||||
override async run(): Promise<void> {
|
||||
@@ -46,7 +47,7 @@ class WebMigrationHelper extends MigrationHelper {
|
||||
storageService: WindowStorageService,
|
||||
logService: LogService,
|
||||
) {
|
||||
super(currentVersion, storageService, logService, "web-disk-local");
|
||||
super(currentVersion, storageService, logService, "web-disk-local", ClientType.Web);
|
||||
this.diskLocalStorageService = storageService;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user