Appearance
Function: setThemeInLocalstorage()
ts
function setThemeInLocalstorage(ctx: Context, theme: {
assistantColor: string;
assistantSecondaryColor: string | null;
}): Promise<void>;Defined in: src/themes/themesConfig.ts:18
Store the theme colors in localStorage and dispatch a theme-initialized event.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The assistant context with page access. |
theme | { assistantColor: string; assistantSecondaryColor: string | null; } | The color values to persist. |
theme.assistantColor | string | - |
theme.assistantSecondaryColor | string | null | - |
Returns
Promise<void>
Example
ts
await setThemeInLocalstorage(ctx, {
assistantColor: '#7B2EFF',
assistantSecondaryColor: '#00C9A7',
});