mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-25 16:39:02 +02:00
Update
This commit is contained in:
@@ -18,7 +18,6 @@ import { useMutation, useQuery } from '@tanstack/react-query';
|
|||||||
import { queryClient } from '../../stores/query-client';
|
import { queryClient } from '../../stores/query-client';
|
||||||
import { billingDetailsOptions } from '../../queries/billing';
|
import { billingDetailsOptions } from '../../queries/billing';
|
||||||
import { useToast } from '../../hooks/use-toast';
|
import { useToast } from '../../hooks/use-toast';
|
||||||
import { readStream } from '../../lib/ai';
|
|
||||||
import { markdownToHtml } from '../../lib/markdown';
|
import { markdownToHtml } from '../../lib/markdown';
|
||||||
import { ChatHistory } from './ChatHistory';
|
import { ChatHistory } from './ChatHistory';
|
||||||
import { PersonalizedResponseForm } from './PersonalizedResponseForm';
|
import { PersonalizedResponseForm } from './PersonalizedResponseForm';
|
||||||
@@ -444,7 +443,7 @@ export function AIChat(props: AIChatProps) {
|
|||||||
<div className="pointer-events-auto flex items-center justify-between gap-2">
|
<div className="pointer-events-auto flex items-center justify-between gap-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<LockIcon className="size-4" strokeWidth={2.5} />
|
<LockIcon className="size-4" strokeWidth={2.5} />
|
||||||
<p>Upgrade to Pro to keep your conversations.</p>
|
<p>Your chat history is not saved.</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
@@ -68,6 +68,7 @@ export function AIChatHistory(props: AIChatHistoryProps) {
|
|||||||
|
|
||||||
setChatHistoryId(undefined);
|
setChatHistoryId(undefined);
|
||||||
window.history.replaceState(null, '', '/ai/chat');
|
window.history.replaceState(null, '', '/ai/chat');
|
||||||
|
setKeyTrigger((key) => key + 1);
|
||||||
},
|
},
|
||||||
[chatHistoryId],
|
[chatHistoryId],
|
||||||
);
|
);
|
||||||
@@ -76,7 +77,6 @@ export function AIChatHistory(props: AIChatHistoryProps) {
|
|||||||
|
|
||||||
const hasError = chatHistoryError || billingDetailsError;
|
const hasError = chatHistoryError || billingDetailsError;
|
||||||
|
|
||||||
// derived UI states to make JSX clearer
|
|
||||||
const showLoader = isChatHistoryLoading && !hasError;
|
const showLoader = isChatHistoryLoading && !hasError;
|
||||||
const showError = !isChatHistoryLoading && Boolean(hasError);
|
const showError = !isChatHistoryLoading && Boolean(hasError);
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@ export function ListChatHistory(props: ListChatHistoryProps) {
|
|||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const deviceType = getTailwindScreenDimension();
|
const deviceType = getTailwindScreenDimension();
|
||||||
const isMediumSize = ['sm', 'md'].includes(deviceType);
|
const isMediumSize = ['sm', 'md'].includes(deviceType);
|
||||||
|
|
||||||
setIsOpen(!isMediumSize);
|
setIsOpen(!isMediumSize);
|
||||||
setIsMobile(isMediumSize);
|
setIsMobile(isMediumSize);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -148,7 +149,7 @@ export function ListChatHistory(props: ListChatHistoryProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="flex w-full items-center justify-center gap-2 rounded-lg bg-black p-2 text-sm text-white"
|
className="flex w-full items-center hover:opacity-80 justify-center gap-2 rounded-lg bg-black p-2 text-sm text-white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
|
Reference in New Issue
Block a user