mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Update Prompt.tsx
This commit is contained in:
@@ -463,9 +463,6 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
}
|
||||
case "create_category": {
|
||||
const [name, setName] = useState("");
|
||||
const [cats, setCats] = useState<Category[]>(
|
||||
props.target.categories ?? [],
|
||||
);
|
||||
const history = useHistory();
|
||||
|
||||
return (
|
||||
@@ -482,12 +479,12 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
onClick: async () => {
|
||||
setProcessing(true);
|
||||
try {
|
||||
cats.push({
|
||||
id: ulid(),
|
||||
title: name,
|
||||
channels: [],
|
||||
props.target.edit({
|
||||
categories: [
|
||||
...props.target.categories ?? [],
|
||||
{ id: ulid(), title: name, channels: [] }
|
||||
]
|
||||
});
|
||||
props.target.edit({ categories: cats });
|
||||
onClose();
|
||||
setProcessing(false);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user