Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Germey committed Mar 2, 2024
1 parent c93e229 commit 1e9d7aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
21 changes: 9 additions & 12 deletions src/pages/chatdoc/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<conversations class="side" />
<div class="chat">
<div class="status">
<api-status
<application-status
:initializing="initializing"
:application="application"
:need-apply="needApply"
:api-id="apiId"
:service="service"
@refresh="$store.dispatch('chatdoc/getApplication')"
/>
</div>
Expand Down Expand Up @@ -56,7 +56,7 @@ import { ROUTE_CHATDOC_CONVERSATION } from '@/router';
import axios from 'axios';
import { isJSONString } from '@/utils/is';
import { Status } from '@/models';
import ApiStatus from '@/components/common/ApiStatus.vue';
import ApplicationStatus from '@/components/application/Status.vue';
import {
IApplication,
IChatdocChatResponse,
Expand All @@ -72,7 +72,7 @@ export default defineComponent({
Conversations,
Message,
InputBox,
ApiStatus
ApplicationStatus
},
data() {
return {
Expand Down Expand Up @@ -106,19 +106,16 @@ export default defineComponent({
return this.$route.params.conversationId?.toString();
},
application() {
return this.applications?.find((application: IApplication) => application.api?.id === API_ID_CHATDOC_CHAT);
},
applications() {
return this.$store.state.chatdoc.applications;
return this.$store.state.chatdoc.application;
},
needApply() {
return this.$store.state.chatdoc.getApplicationStatus === Status.Success && !this.application;
return this.$store.state.chatdoc.status.getApplication === Status.Success && !this.application;
},
initializing() {
return this.$store.state.chatdoc.getApplicationStatus === Status.Request;
return this.$store.state.chatdoc.status.getApplication === Status.Request;
},
apiId() {
return API_ID_CHATDOC_CHAT;
service() {
return this.$store.state.chatdoc.service;
}
},
async mounted() {
Expand Down
29 changes: 13 additions & 16 deletions src/pages/midjourney/History.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="history">
<mode-selector class="mb-4" />
<api-status
<application-status
:initializing="initializing"
:application="application"
:need-apply="needApply"
class="mb-4"
:api-id="channel.apiId"
:service="service"
@refresh="onGetApplications"
/>
<task-full-list @custom="onCustom" />
Expand All @@ -21,7 +21,7 @@
import { defineComponent } from 'vue';
import { ElMessage, ElButton } from 'element-plus';
import ModeSelector from '@/components/midjourney/ModeSelector.vue';
import ApiStatus from '@/components/common/ApiStatus.vue';
import ApplicationStatus from '@/components/application/Status.vue';
import { midjourneyOperator } from '@/operators';
import TaskFullList from '@/components/midjourney/tasks/TaskFullList.vue';
import { ROUTE_MIDJOURNEY_INDEX } from '@/router';
Expand All @@ -42,7 +42,7 @@ export default defineComponent({
components: {
TaskFullList,
ModeSelector,
ApiStatus,
ApplicationStatus,
ElButton,
FontAwesomeIcon
},
Expand All @@ -54,23 +54,20 @@ export default defineComponent({
};
},
computed: {
channel() {
return this.$store.state.midjourney.channel;
mode() {
return this.$store.state.midjourney.mode;
},
applications() {
return this.$store.state.midjourney.applications;
service() {
return this.$store.state.midjourney.service;
},
application() {
return this.$store.state.midjourney.application;
},
initializing() {
return this.$store.state.midjourney.getApplicationStatus === Status.Request;
return this.$store.state.midjourney.status.getApplication === Status.Request;
},
needApply() {
return this.$store.state.midjourney.getApplicationStatus === Status.Success && !this.application;
},
application() {
if (this.applications && this.applications.length > 0) {
return this.applications.filter((item: IApplication) => item.api_id === this.channel.apiId)[0];
}
return undefined;
return this.$store.state.midjourney.status.getApplication === Status.Success && !this.application;
}
},
async mounted() {
Expand Down

0 comments on commit 1e9d7aa

Please sign in to comment.