From 514579918f0c5d84442dde4e21ade44ba5e60f50 Mon Sep 17 00:00:00 2001 From: tmaog Date: Fri, 15 Nov 2024 16:24:51 +0100 Subject: [PATCH 1/3] fix: setupModel update --- src/data/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/api.ts b/src/data/api.ts index f132484..baa72c1 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -60,7 +60,7 @@ const AIAPIGeneration = axiosCreate.create({ SetupModel: '{"secretKey": "' + process.env.SETUPMODEL + - '","modelName": "gpt35Turbo","endpoint": "https://ai4edu.openai.azure.com/"}', + '","modelName": "GPT-4o-MINI","endpoint": "https://ai4edu.openai.azure.com/"}', }, }); From 0b54c5840838ad98b486bac1325f644c202fa7bc Mon Sep 17 00:00:00 2001 From: tmaog Date: Fri, 2 May 2025 11:21:03 +0200 Subject: [PATCH 2/3] fix: bug cach clear --- src/pages/flows/[id]/index.tsx | 2 ++ src/utils/cache.ts | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/utils/cache.ts diff --git a/src/pages/flows/[id]/index.tsx b/src/pages/flows/[id]/index.tsx index 8189690..c1c5cf9 100644 --- a/src/pages/flows/[id]/index.tsx +++ b/src/pages/flows/[id]/index.tsx @@ -20,6 +20,7 @@ import { APIV2 } from '../../../data/api'; import useStore from '../../../store'; import { PolyglotFlow } from '../../../types/polyglotElements'; import auth0 from '../../../utils/auth0'; +import { clearFlowCaches } from '../../../utils/cache'; type FlowIndexProps = { accessToken: string | undefined; @@ -66,6 +67,7 @@ const FlowIndex = ({ accessToken }: FlowIndexProps) => { }); if (returnPath) router.push(returnPath); storeState.updateFlowInfo(response.data); + clearFlowCaches(response.data._id); } else { outputToast && toast({ diff --git a/src/utils/cache.ts b/src/utils/cache.ts new file mode 100644 index 0000000..565084a --- /dev/null +++ b/src/utils/cache.ts @@ -0,0 +1,9 @@ + +export function clearFlowCaches(flowId: string) { + try { + localStorage.removeItem('flow'); + localStorage.removeItem('rescue-' + flowId); + } catch (error) { + console.warn('Failed to clear flow caches', error); + } + } \ No newline at end of file From bcb31fa653610e55f73bd17d685ea0c24661861e Mon Sep 17 00:00:00 2001 From: tmaog Date: Fri, 2 May 2025 11:21:45 +0200 Subject: [PATCH 3/3] fix: bug cach clear --- src/utils/cache.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/utils/cache.ts b/src/utils/cache.ts index 565084a..a9aaec1 100644 --- a/src/utils/cache.ts +++ b/src/utils/cache.ts @@ -1,9 +1,8 @@ - export function clearFlowCaches(flowId: string) { - try { - localStorage.removeItem('flow'); - localStorage.removeItem('rescue-' + flowId); - } catch (error) { - console.warn('Failed to clear flow caches', error); - } - } \ No newline at end of file + try { + localStorage.removeItem('flow'); + localStorage.removeItem('rescue-' + flowId); + } catch (error) { + console.warn('Failed to clear flow caches', error); + } +}