fix: support setting visibility on initial chat creation (#975)
This commit is contained in:
parent
a3221fbcdc
commit
575c12503c
15 changed files with 158 additions and 32 deletions
|
|
@ -12,10 +12,10 @@ import type { VisibilityType } from '@/components/visibility-selector';
|
|||
|
||||
export function useChatVisibility({
|
||||
chatId,
|
||||
initialVisibility,
|
||||
initialVisibilityType,
|
||||
}: {
|
||||
chatId: string;
|
||||
initialVisibility: VisibilityType;
|
||||
initialVisibilityType: VisibilityType;
|
||||
}) {
|
||||
const { mutate, cache } = useSWRConfig();
|
||||
const history: ChatHistory = cache.get('/api/history')?.data;
|
||||
|
|
@ -24,7 +24,7 @@ export function useChatVisibility({
|
|||
`${chatId}-visibility`,
|
||||
null,
|
||||
{
|
||||
fallbackData: initialVisibility,
|
||||
fallbackData: initialVisibilityType,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue