feat: use immidiate watch

This commit is contained in:
Shivam Mishra
2023-07-10 15:04:27 +05:30
parent 9038ec7af9
commit 91227e7120
@@ -71,15 +71,17 @@
</template>
<script>
// components
import WootButton from '../../../ui/WootButton.vue';
import Avatar from '../../Avatar.vue';
import OpenAPI from 'dashboard/api/integrations/openapi';
import aiMixin from 'dashboard/mixins/aiMixin';
// store & api
import { mapGetters } from 'vuex';
import OpenAPI from 'dashboard/api/integrations/openapi';
// utils & constants
import { LocalStorage } from 'shared/helpers/localStorage';
import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage';
import { OPEN_AI_EVENTS } from '../../../../helper/AnalyticsHelper/events';
@@ -148,19 +150,16 @@ export default {
},
},
watch: {
conversationId() {
this.selectedLabels = [];
this.suggestedLabels = [];
this.isDismissed = this.isConversationDismissed();
this.fetchIfRequired();
conversationId: {
immediate: true,
handler() {
this.selectedLabels = [];
this.suggestedLabels = [];
this.isDismissed = this.isConversationDismissed();
this.fetchIfRequired();
},
},
},
mounted() {
this.selectedLabels = [];
this.suggestedLabels = [];
this.isDismissed = this.isConversationDismissed();
this.fetchIfRequired();
},
methods: {
async fetchIfRequired() {
if (this.chatLabels.length !== 0) {