mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
groups: Add browserId to local state
This commit is contained in:
parent
66451c9089
commit
0a5cd0041d
@ -11,6 +11,7 @@ import { clearStorageMigration, createStorageKey, storageVersion, wait } from '~
|
||||
export type SubscriptionStatus = 'connected' | 'disconnected' | 'reconnecting';
|
||||
|
||||
export interface LocalState {
|
||||
browserId: string;
|
||||
theme: 'light' | 'dark' | 'auto';
|
||||
hideAvatars: boolean;
|
||||
hideNicknames: boolean;
|
||||
@ -42,6 +43,7 @@ export const selectLocalState =
|
||||
<K extends keyof LocalState>(keys: K[]) => f.pick<LocalState, K>(keys);
|
||||
|
||||
const useLocalState = create<LocalStateZus>(persist((set, get) => ({
|
||||
browserId: '',
|
||||
dark: false,
|
||||
mobile: false,
|
||||
breaks: {
|
||||
@ -131,4 +133,9 @@ export function useOsDark() {
|
||||
return useLocalState(selOsDark);
|
||||
}
|
||||
|
||||
const selBrowserId = (s: LocalState) => s.browserId;
|
||||
export function useBrowserId() {
|
||||
return useLocalState(selBrowserId);
|
||||
}
|
||||
|
||||
export { useLocalState as default, withLocalState };
|
||||
|
Loading…
Reference in New Issue
Block a user