mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Update Prompt.tsx
This commit is contained in:
parent
49d54ee05a
commit
dccc0f4eb7
1 changed files with 5 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue