mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
[PM-5540] DesktopSettingsService (#8369)
* WIP: First Try at making DesktopSettingsService Does not work, migrations are ran in renderer but the values are read in main. * Update window$ retrieval * Fix DesktopSettings * Rename Migration * Add Migration to Builder * Cleanup * Update Comments * Update `migrate.ts` * Catch Unawaited Promises * Remove Comments * Update Tests * Rename Migration * Add `alwaysOnTop` * Make `init` async * Fix Desktop Build
This commit is contained in:
@@ -178,12 +178,9 @@ export function mockMigrationHelper(
|
||||
return mockHelper;
|
||||
}
|
||||
|
||||
// TODO: Use const generic for TUsers in TypeScript 5.0 so consumers don't have to `as const` themselves
|
||||
export type InitialDataHint<TUsers extends readonly string[]> = {
|
||||
/**
|
||||
* A string array of the users id who are authenticated
|
||||
*
|
||||
* NOTE: It's recommended to as const this string array so you get type help defining the users data
|
||||
*/
|
||||
authenticatedAccounts?: TUsers;
|
||||
/**
|
||||
@@ -282,10 +279,9 @@ function expectInjectedData(
|
||||
* @param initalData The data to start with
|
||||
* @returns State after your migration has ran.
|
||||
*/
|
||||
// TODO: Use const generic for TUsers in TypeScript 5.0 so consumers don't have to `as const` themselves
|
||||
export async function runMigrator<
|
||||
TMigrator extends Migrator<number, number>,
|
||||
TUsers extends readonly string[] = string[],
|
||||
const TUsers extends readonly string[],
|
||||
>(
|
||||
migrator: TMigrator,
|
||||
initalData?: InitialDataHint<TUsers>,
|
||||
|
||||
Reference in New Issue
Block a user