Gives components the signed-in user's settings, which are stored on the
server and kept with the session. ThemeProvider reads the style and
scheme from it, and the settings page the digest switches.
f
useSettings(): UseSettingsResult
Returns the settings and their setter. It must be called under AuthProvider.
I
UseSettingsResult
Returned by useSettings to whatever reads or changes settings.
-
settings: UserSettings | null
The settings, or null when signed out or before
AuthProviderhas read them from the server. -
updateSettings: (patch: UpdateSettingsRequest) => Promise<void>
Applies
patchat once, then saves it withPATCH /api/me/settings. A refusal puts the previous settings back and throws.
Usage
import * as mod from "src/hooks/auth/useSettings.ts";