feat: theme color
This commit is contained in:
@ -23,6 +23,7 @@ export interface LoginSession {
|
||||
muted: ReplaceableTags;
|
||||
cards: ReplaceableTags;
|
||||
emojis: Array<EmojiPack>;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
const initialState = {
|
||||
@ -114,6 +115,12 @@ export class LoginStore extends ExternalStore<LoginSession | undefined> {
|
||||
this.#save();
|
||||
}
|
||||
|
||||
setColor(color: string) {
|
||||
if (!this.#session) return;
|
||||
this.#session.color = color;
|
||||
this.#save();
|
||||
}
|
||||
|
||||
#save() {
|
||||
if (this.#session) {
|
||||
window.localStorage.setItem(SESSION_KEY, JSON.stringify(this.#session));
|
||||
|
Reference in New Issue
Block a user