1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

JSON stringify memory items (#7731)

* JSON stringify memory items

stringification is required so they can be reliably sent through messaging

* Simplify null handling
This commit is contained in:
Matt Gibson
2024-01-29 14:42:58 -05:00
committed by GitHub
parent 76183c839a
commit 1da6733e71
9 changed files with 150 additions and 17 deletions

View File

@@ -30,6 +30,8 @@ import {
GlobalStateProvider,
SingleUserStateProvider,
} from "@bitwarden/common/platform/state";
// eslint-disable-next-line import/no-restricted-paths -- Implementation for memory storage
import { MemoryStorageService as MemoryStorageServiceForStateProviders } from "@bitwarden/common/platform/state/storage/memory-storage.service";
import { PolicyListService } from "../admin-console/core/policy-list.service";
import { HtmlStorageService } from "../core/html-storage.service";
@@ -87,7 +89,7 @@ import { WebPlatformUtilsService } from "./web-platform-utils.service";
provide: MEMORY_STORAGE,
useClass: MemoryStorageService,
},
{ provide: OBSERVABLE_MEMORY_STORAGE, useExisting: MEMORY_STORAGE },
{ provide: OBSERVABLE_MEMORY_STORAGE, useClass: MemoryStorageServiceForStateProviders },
{
provide: OBSERVABLE_DISK_STORAGE,
useFactory: () => new WindowStorageService(window.sessionStorage),