feat: add in prettier and format code for consistency (#168)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { Conversation } from "@/types";
|
||||
import { Conversation } from '@/types';
|
||||
|
||||
export const updateConversation = (updatedConversation: Conversation, allConversations: Conversation[]) => {
|
||||
export const updateConversation = (
|
||||
updatedConversation: Conversation,
|
||||
allConversations: Conversation[],
|
||||
) => {
|
||||
const updatedConversations = allConversations.map((c) => {
|
||||
if (c.id === updatedConversation.id) {
|
||||
return updatedConversation;
|
||||
@@ -14,14 +17,14 @@ export const updateConversation = (updatedConversation: Conversation, allConvers
|
||||
|
||||
return {
|
||||
single: updatedConversation,
|
||||
all: updatedConversations
|
||||
all: updatedConversations,
|
||||
};
|
||||
};
|
||||
|
||||
export const saveConversation = (conversation: Conversation) => {
|
||||
localStorage.setItem("selectedConversation", JSON.stringify(conversation));
|
||||
localStorage.setItem('selectedConversation', JSON.stringify(conversation));
|
||||
};
|
||||
|
||||
export const saveConversations = (conversations: Conversation[]) => {
|
||||
localStorage.setItem("conversationHistory", JSON.stringify(conversations));
|
||||
localStorage.setItem('conversationHistory', JSON.stringify(conversations));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user