mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-26 21:28:50 +01:00
refactor: explicit typing for SharePrompt
This commit is contained in:
parent
0a328e643d
commit
e54352e4c7
1 changed files with 4 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ const SharePrompt = ({ group, disabled }: { group?: TPromptGroup; disabled: bool
|
|||
const { data: startupConfig = {} as TStartupConfig, isFetching } = useGetStartupConfig();
|
||||
const { instanceProjectId } = startupConfig;
|
||||
const groupIsGlobal = useMemo(
|
||||
() => !!group?.projectIds?.includes(instanceProjectId),
|
||||
() => !!(group?.projectIds ?? []).includes(instanceProjectId),
|
||||
[group, instanceProjectId],
|
||||
);
|
||||
|
||||
|
|
@ -57,7 +57,8 @@ const SharePrompt = ({ group, disabled }: { group?: TPromptGroup; disabled: bool
|
|||
}
|
||||
|
||||
const onSubmit = (data: FormValues) => {
|
||||
if (!group._id || !instanceProjectId) {
|
||||
const groupId = group._id ?? '';
|
||||
if (!groupId || !instanceProjectId) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ const SharePrompt = ({ group, disabled }: { group?: TPromptGroup; disabled: bool
|
|||
}
|
||||
|
||||
updateGroup.mutate({
|
||||
id: group._id,
|
||||
id: groupId,
|
||||
payload,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue