Fix Themes Tab
This commit is contained in:
parent
41226f0358
commit
103cd14361
@ -75,11 +75,11 @@ function Validators({ themeLinks }: { themeLinks: string[]; }) {
|
|||||||
|
|
||||||
export default ErrorBoundary.wrap(function () {
|
export default ErrorBoundary.wrap(function () {
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
const ref = React.useRef<HTMLTextAreaElement>(null);
|
const [themeText, setThemeText] = React.useState(settings.themeLinks.join("\n"));
|
||||||
|
|
||||||
function onBlur() {
|
function onBlur() {
|
||||||
settings.themeLinks = [...new Set(
|
settings.themeLinks = [...new Set(
|
||||||
ref.current!.value
|
themeText
|
||||||
.trim()
|
.trim()
|
||||||
.split(/\n+/)
|
.split(/\n+/)
|
||||||
.map(s => s.trim())
|
.map(s => s.trim())
|
||||||
@ -119,8 +119,8 @@ export default ErrorBoundary.wrap(function () {
|
|||||||
padding: ".5em",
|
padding: ".5em",
|
||||||
border: "1px solid var(--background-modifier-accent)"
|
border: "1px solid var(--background-modifier-accent)"
|
||||||
}}
|
}}
|
||||||
ref={ref}
|
value={themeText}
|
||||||
defaultValue={settings.themeLinks.join("\n")}
|
onChange={e => setThemeText(e.currentTarget.value)}
|
||||||
className={TextAreaProps.textarea}
|
className={TextAreaProps.textarea}
|
||||||
placeholder="Theme Links"
|
placeholder="Theme Links"
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
|
Loading…
Reference in New Issue
Block a user