Shun Miyazawa 1 год назад
Родитель
Сommit
c677155d5f
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      apps/app/src/features/openai/client/stores/ai-assistant.tsx

+ 3 - 2
apps/app/src/features/openai/client/stores/ai-assistant.tsx

@@ -1,7 +1,8 @@
 import { useCallback } from 'react';
 
 import { useSWRStatic } from '@growi/core/dist/swr';
-import useSWR, { type SWRResponse } from 'swr';
+import { type SWRResponse } from 'swr';
+import useSWRImmutable from 'swr/immutable';
 
 import { apiv3Get } from '~/client/util/apiv3-client';
 
@@ -45,7 +46,7 @@ export const useAiAssistantManagementModal = (
 
 
 export const useSWRxAiAssistants = (): SWRResponse<AccessibleAiAssistantsHasId, Error> => {
-  return useSWR<AccessibleAiAssistantsHasId>(
+  return useSWRImmutable<AccessibleAiAssistantsHasId>(
     ['/openai/ai-assistants'],
     ([endpoint]) => apiv3Get(endpoint).then(response => response.data.accessibleAiAssistants),
   );