mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-14 22:48:10 +01:00
🗣 fix: Add Various State Change Announcements (#11495)
* fix: Agent Builder Reset button announcements * fix: special variables announcements * fix: model select announcements * fix: prompt deletion announcement * refactor: encapsulate model display name logic * chore: address comments * chore: re-order i18n strings
This commit is contained in:
parent
fcb363403a
commit
46624798b6
5 changed files with 39 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import {
|
|||
import { useDeletePromptGroup, useUpdatePromptGroup } from '~/data-provider';
|
||||
import CategoryIcon from '~/components/Prompts/Groups/CategoryIcon';
|
||||
import { useLocalize, useResourcePermissions } from '~/hooks';
|
||||
import { useLiveAnnouncer } from '~/Providers';
|
||||
import { cn } from '~/utils';
|
||||
|
||||
interface DashGroupItemProps {
|
||||
|
|
@ -25,6 +26,7 @@ function DashGroupItemComponent({ group, instanceProjectId }: DashGroupItemProps
|
|||
const params = useParams();
|
||||
const navigate = useNavigate();
|
||||
const localize = useLocalize();
|
||||
const { announcePolite } = useLiveAnnouncer();
|
||||
|
||||
const blurTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const [nameInputValue, setNameInputValue] = useState(group.name);
|
||||
|
|
@ -49,6 +51,8 @@ function DashGroupItemComponent({ group, instanceProjectId }: DashGroupItemProps
|
|||
const deleteGroup = useDeletePromptGroup({
|
||||
onSuccess: (_response, variables) => {
|
||||
if (variables.id === group._id) {
|
||||
const announcement = localize('com_ui_prompt_deleted', { 0: group.name });
|
||||
announcePolite({ message: announcement, isStatus: true });
|
||||
navigate('/d/prompts');
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue