diff --git a/CHANGELOG.md b/CHANGELOG.md index 71402b78..e86c3ffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _skipped a number since lots of updates :3_ - Pinned messages actually jump to the damn pins instead of somewhere vaguely nearby half the time. - that is... if they've been seen before. otherwise it just gives up sadly. - Mobile context menu is opened by double tapping on a message instead of holding. +- Fixed bio editor formatting. +- Properly clear user data when account settings are updated. ## Version 1.1.1 diff --git a/src/app/features/settings/account/BioEditor.css.ts b/src/app/features/settings/account/BioEditor.css.ts index 48a31423..b5503ba5 100644 --- a/src/app/features/settings/account/BioEditor.css.ts +++ b/src/app/features/settings/account/BioEditor.css.ts @@ -1,23 +1,28 @@ import { style, globalStyle } from '@vanilla-extract/css'; +import { config } from 'folds'; export const BioEditorContainer = style({ backgroundColor: 'var(--sable-bg-container)', - borderRadius: 'var(--radii-300)', + borderRadius: config.radii.R400, + overflow: 'hidden', }); -globalStyle(`${BioEditorContainer} [class*="EditorTextarea"]`, { - backgroundColor: 'var(--sable-bg-container) !important', -}); - -globalStyle(`${BioEditorContainer} [class*="EditorTextareaScroll"]`, { +globalStyle(`${BioEditorContainer} div[class*="EditorTextarea"]`, { backgroundColor: 'var(--sable-bg-container) !important', + border: 'none !important', }); globalStyle(`${BioEditorContainer} [class*="Toolbar"]`, { backgroundColor: 'var(--sable-bg-container) !important', padding: 'var(--space-S100) !important', + borderTop: '1px solid var(--sable-outline-variant) !important', }); globalStyle(`${BioEditorContainer} [class*="Toolbar"] button`, { - backgroundColor: 'var(--sable-bg-container) !important', + backgroundColor: 'transparent !important', + boxShadow: 'none !important', +}); + +globalStyle(`${BioEditorContainer} [class*="Toolbar"] button:hover`, { + backgroundColor: 'var(--sable-surface-variant) !important', }); \ No newline at end of file diff --git a/src/app/features/settings/account/Profile.tsx b/src/app/features/settings/account/Profile.tsx index 9fba38d6..28a6196b 100644 --- a/src/app/features/settings/account/Profile.tsx +++ b/src/app/features/settings/account/Profile.tsx @@ -48,6 +48,8 @@ import { TimezoneEditor } from './TimezoneEditor'; import { PronounEditor } from './PronounEditor'; import { BioEditor } from './BioEditor'; import { NameColorEditor } from './NameColorEditor'; +import { useSetAtom } from 'jotai'; +import { profilesCacheAtom } from '../../../state/userRoomProfile'; type PronounSet = { summary: string; @@ -488,6 +490,7 @@ function ProfileDisplayName({ profile, userId }: ProfileProps) { function ProfileExtended({ profile, userId }: ProfileProps) { const mx = useMatrixClient(); + const setGlobalProfiles = useSetAtom(profilesCacheAtom); const pronouns = (profile.pronouns as PronounSet[]) || []; @@ -495,16 +498,21 @@ function ProfileExtended({ profile, userId }: ProfileProps) { // Only renders them, can't edit or set const extendedFields = Object.entries(profile.extended || {}); - const handleSaveField = useCallback((key: string, value: any) => { - (mx as MatrixClient).setExtendedProfileProperty?.(key, value); - }, [mx]); + const handleSaveField = useCallback(async (key: string, value: any) => { + await (mx).setExtendedProfileProperty?.(key, value); + setGlobalProfiles((prev) => { + const newCache = { ...prev }; + delete newCache[userId]; + return newCache; + }); + }, [mx, userId, setGlobalProfiles]); return ( Extended Profile handleSaveField("moe.sable.app.name_color", color)} />