Skip to content

Commit

Permalink
fix local
Browse files Browse the repository at this point in the history
  • Loading branch information
JYC0413 committed Sep 9, 2024
1 parent c9ec8fb commit 6b2d602
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/Chatbar/Chatbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const Chatbar = () => {
homeDispatch({ field: 'conversations', value: [] });
homeDispatch({ field: 'selectedConversation', value: null });

localStorage.removeItem(`conversationHistory_${selectedNode?.subdomain}`);
localStorage.removeItem(`conversationHistory`);
localStorage.removeItem('selectedConversation');

const updatedFolders = folders.filter((f) => f.type !== 'chat');
Expand Down
2 changes: 1 addition & 1 deletion pages/api/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const Home = ({}) => {
useEffect(() => {
if (!selectedNode?.subdomain) return;
const conversationHistory = localStorage.getItem(
`conversationHistory_${selectedNode?.subdomain}`
`conversationHistory`
);
const selectedConversation = localStorage.getItem("selectedConversation");
if(selectedConversation){
Expand Down
2 changes: 1 addition & 1 deletion pages/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const handler = async (req: Request): Promise<Response> => {
key: string;
};

let url = `${OPENAI_API_HOST}/v1/models`;
let url = `/v1/models`;
if (OPENAI_API_TYPE === 'azure') {
url = `${OPENAI_API_HOST}/openai/deployments?api-version=${OPENAI_API_VERSION}`;
}
Expand Down
2 changes: 1 addition & 1 deletion utils/app/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export const saveConversation = (conversation: Conversation) => {
};

export const saveConversations = (conversations: Conversation[], subdomain: string | null | undefined) => {
localStorage.setItem(`conversationHistory_${subdomain}`, JSON.stringify(conversations));
localStorage.setItem(`conversationHistory`, JSON.stringify(conversations));
};

0 comments on commit 6b2d602

Please sign in to comment.