From 2be42e521a57aedddbf30dd0c083df8993ee28ca Mon Sep 17 00:00:00 2001 From: AceDataCloud Date: Wed, 17 Apr 2024 02:38:18 +0800 Subject: [PATCH] Fix apply issue for application (#28) --- ...datacloud-hub-220318f0-72ba-4785-806c-9bf1c847bba9.json | 7 +++++++ src/store/chat/actions.ts | 2 +- src/store/chatdoc/actions.ts | 2 +- src/store/midjourney/actions.ts | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 change/@acedatacloud-hub-220318f0-72ba-4785-806c-9bf1c847bba9.json diff --git a/change/@acedatacloud-hub-220318f0-72ba-4785-806c-9bf1c847bba9.json b/change/@acedatacloud-hub-220318f0-72ba-4785-806c-9bf1c847bba9.json new file mode 100644 index 00000000..779b45bd --- /dev/null +++ b/change/@acedatacloud-hub-220318f0-72ba-4785-806c-9bf1c847bba9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix bug of applying", + "packageName": "@acedatacloud/hub", + "email": "cqc@cuiqingcai.com", + "dependentChangeType": "patch" +} diff --git a/src/store/chat/actions.ts b/src/store/chat/actions.ts index 872c7943..11253707 100644 --- a/src/store/chat/actions.ts +++ b/src/store/chat/actions.ts @@ -81,7 +81,7 @@ export const getApplication = async ({ .then((response) => { state.status.getApplication = Status.Success; commit('setApplication', response.data.items[0]); - const credential = response.data.items?.[0].credentials?.find( + const credential = response.data.items?.[0]?.credentials?.find( (credential) => credential?.host === window.location.origin ); commit('setCredential', credential); diff --git a/src/store/chatdoc/actions.ts b/src/store/chatdoc/actions.ts index 6a74fe0c..4f94cfb3 100644 --- a/src/store/chatdoc/actions.ts +++ b/src/store/chatdoc/actions.ts @@ -48,7 +48,7 @@ export const getApplication = async ({ .then((response) => { state.status.getApplication = Status.Success; commit('setApplication', response.data.items[0]); - const credential = response.data.items?.[0].credentials?.find( + const credential = response.data.items?.[0]?.credentials?.find( (credential) => credential?.host === window.location.origin ); commit('setCredential', credential); diff --git a/src/store/midjourney/actions.ts b/src/store/midjourney/actions.ts index 8ba178a0..bb5f7bf0 100644 --- a/src/store/midjourney/actions.ts +++ b/src/store/midjourney/actions.ts @@ -56,7 +56,7 @@ export const getApplication = async ({ .then((response) => { state.status.getApplication = Status.Success; commit('setApplication', response.data.items[0]); - const credential = response.data.items?.[0].credentials?.find( + const credential = response.data.items?.[0]?.credentials?.find( (credential) => credential?.host === window.location.origin ); commit('setCredential', credential);