diff --git a/src/components/list-add-edit.jsx b/src/components/list-add-edit.jsx index 4b19be0e..5e5027a3 100644 --- a/src/components/list-add-edit.jsx +++ b/src/components/list-add-edit.jsx @@ -1,6 +1,7 @@ import { useEffect, useRef, useState } from 'preact/hooks'; import { api } from '../utils/api'; +import supports from '../utils/supports'; import Icon from './icon'; import MenuConfirm from './menu-confirm'; @@ -11,12 +12,18 @@ function ListAddEdit({ list, onClose }) { const editMode = !!list; const nameFieldRef = useRef(); const repliesPolicyFieldRef = useRef(); + const exclusiveFieldRef = useRef(); useEffect(() => { if (editMode) { nameFieldRef.current.value = list.title; repliesPolicyFieldRef.current.value = list.repliesPolicy; + if (exclusiveFieldRef.current) { + exclusiveFieldRef.current.checked = list.exclusive; + } } }, [editMode]); + const supportsExclusive = supports('@mastodon/list-exclusive'); + return (