1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

ActiveUserState Update should return the userId of the impacted user. (#7869)

This allows us to ensure that linked updates all go to the same user without risking active account changes in the middle of an operation.
This commit is contained in:
Matt Gibson
2024-02-08 14:54:15 -05:00
committed by GitHub
parent 78730ff18a
commit 4c051f8d7f
7 changed files with 63 additions and 31 deletions

View File

@@ -36,7 +36,11 @@ export abstract class StateProvider {
* @param value - The value to set the state to.
* @param userId - The userId for which you want to set the state for. If not provided, the state for the currently active user will be set.
*/
setUserState: <T>(keyDefinition: KeyDefinition<T>, value: T, userId?: UserId) => Promise<void>;
setUserState: <T>(
keyDefinition: KeyDefinition<T>,
value: T,
userId?: UserId,
) => Promise<[UserId, T]>;
/** @see{@link ActiveUserStateProvider.get} */
getActive: <T>(keyDefinition: KeyDefinition<T>) => ActiveUserState<T>;
/** @see{@link SingleUserStateProvider.get} */